2012-10-12 75 views
3

可能重复:
bundle install fails with SSL certificate verification error宝石:: RemoteFetcher :: FetchError - 证书捆绑在验证失败安装

我有蒙山bundle install问题。他不工作。
的Gemfile:

source 'https://rubygems.org' 

gem 'rails', '3.2.8' 

gem 'sqlite3' 

group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

    gem 'uglifier', '>= 1.0.3' 
end 

gem "jquery-rails", "~> 2.1.3" 

当我执行命令bundle install我收到:

D:\ruby\work\myPage>bundle install 
Fetching gem metadata from https://rubygems.org/......... 
Using rake (0.9.2.2) 
Using i18n (0.6.1) 
Using multi_json (1.3.6) 
Using activesupport (3.2.8) 
Using builder (3.0.3) 
Using activemodel (3.2.8) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.1) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.1) 
Using tilt (1.3.3) 
Using sprockets (2.1.3) 
Using actionpack (3.2.8) 
Using mime-types (1.19) 
Using polyglot (0.3.3) 
Using treetop (1.4.11) 
Using mail (2.4.4) 
Using actionmailer (3.2.8) 
Using arel (3.0.2) 
Using tzinfo (0.3.33) 
Using activerecord (3.2.8) 
Using activeresource (3.2.8) 
Using bundler (1.2.1) 
Using coffee-script-source (1.3.3) 
Using execjs (1.4.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 

Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read 
server certificate B: certificate verify failed (https://rubygems.org/gems/json-1.7.5.gem) 
An error occurred while installing json (1.7.5), and Bundler cannot continue. 
Make sure that `gem install json -v '1.7.5'` succeeds before bundling. 

然后我尝试启动服务器rails server

D:\ruby\work\myPage>rails server 
←[31mCould not find gem 'sqlite3 (>= 0) x86-mingw32' in the gems available on this machine.←[0m 
←[33mRun `bundle install` to install missing gems.←[0m 

,这可能是问题吗?以及如何解决它?

+0

@cdesrosiers“rails server”仍然不能正常工作 –

+0

如果由于'sqlite3' gem仍然失败,请确保您的计算机上已安装sqlite数据库。 – cdesrosiers

回答

1

我解决了这个问题。我彻底删除了Ruby。并重新安装它。

+0

我从OSX 10.7更新到10.9,并且有完全相同的问题。重新安装Ruby是修复它的唯一的东西。 –

+0

我想撤消我的downvote,但堆栈溢出说我的投票是“锁定”。我认为我downvoted,因为我不希望这是最好的答案,因为它不是最好的答案,如果有什么别的作品(他们 - 他们做),但它仍然有帮助。 –

7

这是因为您的rubygems版本中存在错误。

您可以运行

gem update --system 

或者删除您源在你的Gemfile,像这样:

source 'http://rubygems.org' 
+0

HTTPS只是一个安全层,但是放弃S通常是不负责任的。需要说。坏主意,长期。 –

+0

是的,我们不希望我们的宝石请求以纯文本形式出去...... –

+1

布拉德,担心的不是有人会看到你使用的是什么宝石,而是它打开你为一个男人在这里中间人攻击,在这种攻击中,某人可以提供一个篡改的宝石,比如说可以让某人访问数据库的后门程序。可能性有多大?不,但你为什么要这种可能性? (无论如何,如果你想要可靠的部署,最好的做法是自己托管宝石,但这是一个单独的问题。) –

0

解释这个错误可以在这里找到

http://railsapps.github.com/openssl-certificate-verify-failed.html

检查你的红宝石版本,你rubygems版本

然后使用gem update --system修复它

+0

我做了一个'gem update --system',但是当我运行'bundle'时,这个错误依然存在。我的'gem -v'是2.1.9,甚至比rubygems.org上的下载链接(目前2.1.7)更新。什么? –

+0

你的rubygems版本比最新更新? –

+0

我认为他们很慢更新网站。 –