環境構築:Redmine:gemインストール補足

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
環境構築:Redmine:gemインストール補足 [2022/11/30 08:44] – 削除 - 外部編集 (Unknown date) 127.0.0.1環境構築:Redmine:gemインストール補足 [2025/04/12 05:15] (現在) – 外部編集 127.0.0.1
行 1: 行 1:
 +### gemインストール補足
 +
 +下記のコマンドを実行すると、正常にインストールすることは出来なかった。
 +
 +```
 +$ bundle install --without development test --path vendor/bundle
 +```
 +
 +下記が出力されたエラー文の抜粋
 +
 +```
 +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: /var/lib/redmine/vendor/bundle/ruby/2.4.0/gems/mysql2-0.5.3/ext/mysql2
 +/opt/rh/rh-ruby24/root/usr/bin/ruby -I /opt/rh/rh-ruby24/root/usr/local/share/ruby/site_ruby -r
 +./siteconf20220430-29545-aq1lkd.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 -lmysqlclient... no
 +-----
 +mysql client is missing. You may need to 'sudo apt-get install libmariadb-dev', 'sudo apt-get
 +install libmysqlclient-dev' or 'sudo yum install mysql-devel', and try again.
 +-----
 +*** 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.
 +```
 +
 +エラー文より、「mysql client」が不足しているのが分かる。
 +
 +そこで、下記のコマンドを実行する。
 +
 +```
 +$ yum install mysql-client
 +```
 +
 +しかし、またもエラーが出力される。下記は抜粋。
 +
 +```
 +curl#77 - "Problem with the SSL CA cert (path? access rights?)"
 +・・・
 +・・・
 +The GPG keys listed for the "MySQL 8.0 Community Server" repository are already installed but they are not correct for this package.
 +Check that the correct key URLs are configured for this repository.
 +```
 +
 +1行目のエラーから、何かしら「SSL CA」に問題があることが分かる。
 +
 +とりあえず、エラーをそのままググると次のページが参考にできた。
 +
 +https://bobcares.com/blog/curl-error-77-problem-with-the-ssl-ca-cert/
 +
 +上記サイトを参考に、CA証明書を削除して、再インストールを実施する。
 +
 +```
 +$ rm -f /etc/ssl/certs/ca-bundle.crt
 +$ yum reinstall -y ca-certificates
 +```
 +
 +その後、再度 //$ yum install mysql-client// を実行すると正常にインストールできた。
 +
 +さらに、最終的に // $ bundle install --without development test --path vendor/bundle // も正常に完了した。
 +
 +##### 参考サイト
 +
 +https://zenn.dev/kosuke_ito/articles/0d508035bcd570
 +
 +https://qiita.com/ogatamaquzilla/items/7f2e90806f3b6851e7b0
 +
 +https://cpoint-lab.co.jp/article/202203/22214/
 +
 +https://bobcares.com/blog/curl-error-77-problem-with-the-ssl-ca-cert/
 +
 +
 +