Centos7 や Centos8 での情報は散見されたが、Centos9 の場合は情報が無かったので記載する。
以下のようなエラー
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /usr/share/gems/gems/mysql2-0.5.4/ext/mysql2 /usr/bin/ruby -I /usr/share/rubygems -r ./siteconf20220516-45530-uvk74g.rb extconf.rb 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}/lib64 --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/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}/lib64 --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}/lib64 --with-mysqlclientlib --without-mysqlclientlib /usr/share/ruby/mkmf.rb:1050:in `block in find_library': undefined method `split' for nil:NilClass (NoMethodError) from /usr/share/ruby/mkmf.rb:1050:in `collect' from /usr/share/ruby/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: /usr/lib64/gems/ruby/mysql2-0.5.4/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /usr/share/gems/gems/mysql2-0.5.4 for inspection. Results logged to /usr/lib64/gems/ruby/mysql2-0.5.4/gem_make.out /usr/share/rubygems/rubygems/ext/builder.rb:93:in `run' /usr/share/rubygems/rubygems/ext/ext_conf_builder.rb:47:in `block in build' /usr/share/ruby/tempfile.rb:317:in `open' /usr/share/rubygems/rubygems/ext/ext_conf_builder.rb:26:in `build' /usr/share/rubygems/rubygems/ext/builder.rb:159:in `build_extension' /usr/share/rubygems/rubygems/ext/builder.rb:193:in `block in build_extensions' /usr/share/rubygems/rubygems/ext/builder.rb:190:in `each' /usr/share/rubygems/rubygems/ext/builder.rb:190:in `build_extensions' /usr/share/rubygems/rubygems/installer.rb:845:in `build_extensions' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/rubygems_gem_installer.rb:71:in `build_extensions' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/rubygems_gem_installer.rb:28:in `install' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/source/rubygems.rb:200:in `install' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/installer/gem_installer.rb:54:in `install' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/installer/parallel_installer.rb:186:in `do_install' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/worker.rb:62:in `apply_func' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/worker.rb:57:in `block in process_queue' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/worker.rb:54:in `loop' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/worker.rb:54:in `process_queue' /usr/share/gems/gems/bundler-2.2.32/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads' An error occurred while installing mysql2 (0.5.4), and Bundler cannot continue. In Gemfile: mysql2 |
必要なのは以下
1 2 3 |
$ sudo dnf install mariadb-connector-c-devel |