お疲れ様です。
質問お願いします。
railsアプリをnewして、bundle installしたところ、
Fetching mysql2 0.5.3 Installing mysql2 0.5.3 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/codebase/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mysql2-0.5.3/ext/mysql2 /home/codebase/.rbenv/versions/2.7.1/bin/ruby -I /home/codebase/.rbenv/versions/2.7.1/lib/ruby/2.7.0 -r ./siteconf20201024-233-humpb8.rb extconf.rb --with-opt-lib\=/usr/local/opt/openssl/lib --with-opt-include\=-I/usr/local/opt/openssl/include checking for rb_absint_size()... yes checking for rb_absint_singlebit_p()... yes checking for rb_wait_for_single_fd()... yes *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include=${opt-dir}/include --with-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/codebase/.rbenv/versions/2.7.1/bin/$(RUBY_BASE_NAME) --with-mysql-dir --without-mysql-dir --with-mysql-include --without-mysql-include=${mysql-dir}/include --with-mysql-lib --without-mysql-lib=${mysql-dir}/lib --with-mysql-config --without-mysql-config --with-mysqlclient-dir --without-mysqlclient-dir --with-mysqlclient-include --without-mysqlclient-include=${mysqlclient-dir}/include --with-mysqlclient-lib --without-mysqlclient-lib=${mysqlclient-dir}/lib --with-mysqlclientlib --without-mysqlclientlib /home/codebase/.rbenv/versions/2.7.1/lib/ruby/2.7.0/mkmf.rb:1050:in `block in find_library': undefined method `split' for nil:NilClass (NoMethodError) from /home/codebase/.rbenv/versions/2.7.1/lib/ruby/2.7.0/mkmf.rb:1050:in `collect' from /home/codebase/.rbenv/versions/2.7.1/lib/ruby/2.7.0/mkmf.rb:1050:in `find_library' from extconf.rb:87:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/codebase/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/mysql2-0.5.3/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/codebase/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/mysql2-0.5.3 for inspection. Results logged to /home/codebase/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/mysql2-0.5.3/gem_make.out An error occurred while installing mysql2 (0.5.3), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: mysql2
のようなエラーが出ます。
なので、色々ググってみて
gem install mysql2 -v '0.5.3' --source 'https://rubygems.org/'
$ bundle config --local build.mysql2 "--with-ldflags=-L/usr/local/opt/openssl/lib" $ bundle install
$ bundle config --local build.mysql2 "--with-cppflags=-I/usr/local/opt/openssl/include" $ bundle install
のようなコードを試したり、
gem 'mysql2', '~> 0.5.3'
をGem
に追加してもmysql
をインストールすることができません。
解決方法分かる方いましたらご教授お願いします。
回答2件
あなたの回答
tips
プレビュー