現状
windows10においてrails6 + mysqlの環境を構築したいのですが、
mysql2のgemをインストールする段階でエラーになり先に進めなくなりました。
mysqlが駄目なら、ポスグレやsqlite3のままでもいいかとは思ったのですが
以前同じ環境で構築ができたため何が原因なのかを知りたいです。
遭遇しているエラー
以下エラーログを貼らせていただきます。
Temporarily enhancing PATH for MSYS/MINGW... Using msys2 packages: mingw-w64-x86_64-libmariadbclient Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3/ext/mysql2 C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r ./siteconf20220420-17940-w09axm.rb extconf.rb 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 --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=C:/Ruby30-x64/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 C:/Ruby30-x64/lib/ruby/3.0.0/mkmf.rb:1050:in block in find_library': undefined methodsplit' for nil:NilClass (NoMethodError) from C:/Ruby30-x64/lib/ruby/3.0.0/mkmf.rb:1050:in collect' from C:/Ruby30-x64/lib/ruby/3.0.0/mkmf.rb:1050:infind_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: C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/mysql2-0.5.3/mkmf.log extconf failed, exit code 1 Gem files will remain installed in C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mysql2-0.5.3 for inspection. Results logged to C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/mysql2-0.5.3/gem_make.out
調べてみるとopensslやrubyのバージョンが高すぎるからいけないだとか
色々出てきましたがいまいち解決に繋がりません。
ログの通りmkmf.logも見てみましたがどれが原因なのかも分かりませんでした。
申し訳ありませんがよろしくお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/04/26 06:19
退会済みユーザー
2022/04/26 07:12 編集