在bundle安装期间尝试安装mysql2 gem,CertificateFailureError

时间:2013-03-12 22:13:51

标签: ruby-on-rails bundler

Jason-Kim-MacBook-Pro:composer jkim$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Fetching source index from https://rubygems.org/
Resolving dependencies...

Bundler::Fetcher::CertificateFailureError: 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 certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ssl-certs. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
An error occurred while installing rake (10.0.3), and Bundler cannot continue.
Make sure that `gem install rake -v '10.0.3'` succeeds before bundling.

我的gemfile包含gem "mysql2"

我是OS X Lion,并使用Ruby 1.8.7。 Rails是3.2.12。

我安装了rake btw。

Jason-Kim-MacBook-Pro:composer jkim$ gem install rake -v '10.0.3'
Successfully installed rake-10.0.3
1 gem installed
Installing ri documentation for rake-10.0.3...
Installing RDoc documentation for rake-10.0.3...

1 个答案:

答案 0 :(得分:1)

仍然不知道究竟是什么问题,但我通过不使用https修复了它。

在您的gemfile中,将源更改为source 'http://rubygems.org'