在 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 綁定運行。

:)

相關內容