我正在尝试在rails上安装ruby,但是当我尝试创建应用程序时,我仍然遇到很多错误。
以下是我在Windows机器上的操作:
1)下载railsinstaller-3.0.0.exe
软件
2)在我的机器上安装了Rails。
3)验证安装是否成功:
E:\ Rails> ruby -v ruby 2.0.0p598(2014-11-13)[i386-mingw32]
E:\ Rails> sqlite3 --version 3.8.7.2 2014-11-18 20:57:56 2ab564bf9655b7c7b97ab85cafc8a48329b27f93
E:\ Rails> rails -v DL已弃用,请使用Fiddle Rails 4.1.8
现在,当我尝试创建一个应用程序时,我遇到了异常:
使用的命令是:rails new blog
run bundle install
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/rake-10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'` succeeds before bundling.
现在我尝试运行此命令 - gem install rake -v '10.4.2'
,我现在开始收到以下错误:
E:\Rails>gem install rake -v '10.4.2'
ERROR: Could not find a valid gem 'rake' (= 10.4.2), 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://rubygems.org/specs.4.8.gz)
我完全被困在这里,你能告诉我在这个装置中犯了什么错吗?我在SO中尝试了各种选项,但我一直都失败了。
如果我尝试启动服务器,那么我将获得以下异常:
E:\Rails> cd blog
E:\Rails\blog>rails server
Could not find gem 'tzinfo-data (>= 0) x86-mingw32' in the gems available on this machine.
Run `bundle install` to install missing gems.
现在如果我运行bundle install
我收到新错误:
E:\Rails\blog>bundle install
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://rubygems.org/gems/rake-10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'` succeeds before bundling.
如果我尝试安装rake,我会再次遇到新的异常:
E:\Rails\blog>gem install rake -v '10.4.2'
ERROR: Could not find a valid gem 'rake' (= 10.4.2), 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://rubygems.org/specs.4.8.gz)
过去两天我都在尝试这个,但我仍然无法理解安装错误的地方。
答案 0 :(得分:2)
更新您的GemFile: 从
https://rubygems.org
到
http://rubygems.org
答案 1 :(得分:1)
gem update --system
将安装最新版本的Rubygems,包括正确的最新信任证书。
答案 2 :(得分:0)
如何在Ruby中添加信任证书
SL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
的解决方案在这里:How to Manually add Trust Certificate
<小时/> 感谢@luislavena解决方案&amp; @BenY的答案。