在 Windows7 上安装 Rspec 困难

在 Windows7 上安装 Rspec 困难

我有 ruby​​ 2.2.5p319,Bundler 版本 1.13.1 并gem -v告诉我 2.4.5.1

参观后http://rspec.info/我创建了一个 Gemfile 并尝试了他们建议的捆绑命令:

PS C:\Users\user\stuff\Ruby\project> bundle install --binstubs
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/.
Resolving dependencies...
Using bundler 1.13.1
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed
(https://rubygems.org/gems/diff-lcs-1.2.5.gem)
An error occurred while installing diff-lcs (1.2.5), and Bundler cannot
continue.
Make sure that `gem install diff-lcs -v '1.2.5'` succeeds before bundling.

因此,我尝试了一下,希望能够成功:

PS C:\Users\user\stuff\Ruby\project> gem install diff-lcs -v '1.2.5'
ERROR:  Could not find a valid gem 'diff-lcs' (= 1.2.5), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server ce
rtificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

此时,我四处寻找答案,但无法解决这些错误。值得注意的是,我找到了一个涵盖 Windows 安装的教程:https://www.tutorialspoint.com/rspec/rspec_introduction.htm并推荐使用以下 gem 命令来安装 Rspec:

PS C:\Users\user\stuff\Ruby\project> gem install rspec
ERROR:  Could not find a valid gem 'rspec' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server ce
rtificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

我需要做什么才能在装有 Windows 7 的 HP 笔记本电脑上安装 Rspec?提前致谢!

答案1

按照这里概述的步骤,我得到了一个可以正常运行的 gem 安装程序:http://guides.rubygems.org/ssl-certificate-update/

...我已经开始运行 Gemfile 绑定了。

:)

相关内容