2013-10-06 159 views
1

我在安裝Rails 4時遇到了問題。希望你能幫上忙!安裝Rails 4時出錯

演示

$ rails -v 
Rails is not currently installed on this system. To get the latest version, simply type: 

$ sudo gem install rails 

You can then rerun your "rails" command. 

演示

$ sudo gem install rails 

WARNING: Improper use of the sudo command could lead to data loss 
or the deletion of important system files. Please double-check your 
typing when using sudo. Type "man sudo" for more information. 

To proceed, enter your password, or type Ctrl-C to abort. 

Password: 
ERROR: Could not find a valid gem 'rails' (>= 0), here is why: 
     Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz) 

回答

0

安裝Rails的最好的解決方案是使用Ruby版本管理器(RVM

運行curl -L https://get.rvm.io | bash -s stable安裝RVM和安裝Ruby通過此命令使用RVM rvm install 2.0.0然後從此命令安裝Rails

gem install rails -v 4.0.0

你可以很好去那麼。

0

有同樣的問題,並在此說明一切:http://railsapps.github.io/openssl-certificate-verify-failed.html

TL;博士最近RVM的版本中,Ruby的版本管理工具,包括工具來診斷並解決由於過時的證書文件中的錯誤。有關說明和建議,請參閱安裝Rails文章。 RVM網站介紹瞭如何安裝RVM。

如果您已經安裝了RVM,試試這個:

$ rvm -v 
# rvm 1.19.1 (stable) 
$ rvm osx-ssl-certs status all 
# Certificates for... 
$ rvm osx-ssl-certs update all 
# Updating certificates... 

這就是所有需要的,如果你正在使用RVM來解決問題(您必須使用RVM版本1.19.1或更新版本)。