bundle installの際のmysqlのエラー

実現したいこと

ruby on railsのプロジェクトを作成しまして、 bundle installした際にエラーが発生しました。
mysql2に関するエラーでした。
検索して、bundle installからmysqlをインストールしようとしたりしたのですが、失敗しました。
mysql2を入れる方法はありますか?

発生している問題・エラーメッセージ

Your Gemfile lists the gem rails-i18n (>= 0) more than once. You should probably keep only one of them. Remove any duplicate entries and specify the gem only once. While it's not a problem now, it could cause errors if you change the version of one of them later. Fetching gem metadata from https://rubygems.org/.......... Using rake 13.0.6 Using concurrent-ruby 1.1.10 Using i18n 1.12.0 Using minitest 5.16.3 Using tzinfo 2.0.5 Using zeitwerk 2.6.0 Using activesupport 6.1.7 Using builder 3.2.4 Using erubi 1.11.0 Using racc 1.6.0 Using nokogiri 1.13.8 (x86_64-linux) Using rails-dom-testing 2.0.3 Using crass 1.0.6 Using loofah 2.19.0 Using rails-html-sanitizer 1.4.3 Using actionview 6.1.7 Using rack 2.2.4 Using rack-test 2.0.2 Using actionpack 6.1.7 Using nio4r 2.5.8 Using websocket-extensions 0.1.5 Using websocket-driver 0.7.5 Using actioncable 6.1.7 Using globalid 1.0.0 Using activejob 6.1.7 Using activemodel 6.1.7 Using activerecord 6.1.7 Using marcel 1.0.2 Using mini_mime 1.1.2 Using activestorage 6.1.7 Using mail 2.7.1 Using actionmailbox 6.1.7 Using actionmailer 6.1.7 Using actiontext 6.1.7 Using public_suffix 5.0.0 Using addressable 2.8.1 Using aws_cf_signer 0.1.3 Using bcrypt 3.1.18 Using coderay 1.1.3 Using better_errors 2.9.1 Using bindex 0.8.1 Using debug_inspector 1.1.0 Using binding_of_caller 1.0.0 Using msgpack 1.5.6 Using bootsnap 1.13.0 Using kaminari-core 1.2.2 Using kaminari-actionview 1.2.2 Using kaminari-activerecord 1.2.2 Using kaminari 1.2.2 Using bundler 2.2.3 Using method_source 1.0.0 Using thor 1.2.1 Using railties 6.1.7 Using sprockets 4.1.1 Using sprockets-rails 3.4.2 Using rails 6.1.7 Using bootstrap5-kaminari-views 0.0.1 Using byebug 11.1.3 Using mime-types-data 3.2022.0105 Using mime-types 3.4.1 Using ssrf_filter 1.1.1 Using carrierwave 1.3.2 Using http-accept 1.7.0 Using unf_ext 0.0.8.2 Using unf 0.1.4 Using domain_name 0.5.20190701 Using http-cookie 1.0.5 Using netrc 0.11.0 Using rest-client 2.1.0 Using cloudinary 1.25.0 Using orm_adapter 0.5.0 Using responders 3.0.1 Using warden 1.2.9 Using devise 4.8.1 Using devise-i18n 1.10.2 Using dotenv 2.8.1 Using dotenv-rails 2.8.1 Using ffi 1.15.5 Using jbuilder 2.11.5 Using launchy 2.5.0 Using letter_opener 1.8.1 Using rexml 3.2.5 Using letter_opener_web 2.0.0 Using rb-fsevent 0.11.2 Using rb-inotify 0.10.1 Using listen 3.7.1 Using mini_magick 4.11.0 Fetching mysql2 0.5.4 Installing mysql2 0.5.4 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/ubuntu/environment/tsunageru/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.4/ext/mysql2 /home/ubuntu/.rvm/rubies/ruby-3.0.0/bin/ruby -I /home/ubuntu/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0 -r ./siteconf20230707-5946-jx294h.rb extconf.rb --with-ldflags\=-L/usr/local/opt/openssl/lib --with-cppflags\=-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 checking for rb_enc_interned_str() in ruby.h... 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 --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/ubuntu/.rvm/rubies/ruby-3.0.0/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/ubuntu/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/mkmf.rb:1050:in `block in find_library': undefined method `split' for nil:NilClass (NoMethodError) from /home/ubuntu/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/mkmf.rb:1050:in `collect' from /home/ubuntu/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/mkmf.rb:1050:in `find_library' from extconf.rb:103:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/ubuntu/environment/tsunageru/vendor/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/mysql2-0.5.4/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/ubuntu/environment/tsunageru/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.4 for inspection. Results logged to /home/ubuntu/environment/tsunageru/vendor/bundle/ruby/3.0.0/extensions/x86_64-linux/3.0.0/mysql2-0.5.4/gem_make.out An error occurred while installing mysql2 (0.5.4), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.5.4' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: mysql2

補足情報(FW/ツールのバージョンなど)

ruby 3
rails 6

コメントを投稿

0 コメント