LoginSignup
3
4

More than 5 years have passed since last update.

bundle install の SSL 証明書エラー対応

Posted at

TL;DR

証明書エラー

bundle install すると, 以下のエラーが出た.

$ bundle install
Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching source index from https://rubygems.org/
Could not verify the SSL certificate for https://rubygems.org/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA 

OpenSSl が OSX の古い証明書を参照しているようだ.

ruby -ropenssl -e "p OpenSSL::X509::DEFAULT_CERT_FILE"

上のコマンドで証明書の場所を確認.
証明書をアップデートすることに.

対処方法その一: rvm の場合

rvm を使っている場合は以下で対処可能とのこと.

rvm osx-ssl-certs update all

OpenSSL Errors and Rails – Certificate Verify Failed · RailsApps
http://railsapps.github.io/openssl-certificate-verify-failed.html

対処方法その二: そのまま更新

残念ながら, rbenv を利用しているので, 参照している証明書を更新した.

sudo curl "https://curl.haxx.se/ca/cacert.pem" -o /usr/local/etc/openssl/cert.pem

対処方法その三: homebrew を使う

以下の方法でも対処可能

$ brew update
$ brew install openssl
$ brew link openssl --force
$ brew install curl-ca-bundle
3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4