安装Rails 4时出错

时间:2013-10-06 06:05:36

标签: ruby-on-rails

我在安装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)

2 个答案:

答案 0 :(得分:0)

安装Rails的最佳解决方案是使用Ruby版本管理器( RVM

运行curl -L https://get.rvm.io | bash -s stable以通过此命令rvm install 2.0.0安装RVM和使用RVM安装Ruby,然后从此命令安装Rails

gem install rails -v 4.0.0

你可以好好去。

答案 1 :(得分:0)

有同样的问题,所有内容都在这里描述:http://railsapps.github.io/openssl-certificate-verify-failed.html

tl; dr 最新版本的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或更高版本),那就是解决问题所需的全部内容。