2013-02-28 92 views
0

我是Ruby的新手,我一直在通過lynda.com的ruby on rails必備程序。創建新項目時導致ruby on rails openssl錯誤

我使用windows7的紅寶石2.0並有欄杆3.2.12

但是創建Ruby項目時,我得到這個錯誤。

  run bundle install 
E:/Ruby200/lib/ruby/2.0.0/net/http.rb:917:in `connect': SSL_connect returned=1 e 
rrno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL 
::SSL::SSLError) 
     from E:/Ruby200/lib/ruby/2.0.0/net/http.rb:917:in `block in connect' 
     from E:/Ruby200/lib/ruby/2.0.0/timeout.rb:51:in `timeout' 
     from E:/Ruby200/lib/ruby/2.0.0/net/http.rb:917:in `connect' 
     from E:/Ruby200/lib/ruby/2.0.0/net/http.rb:861:in `do_start' 
     from E:/Ruby200/lib/ruby/2.0.0/net/http.rb:856:in `start' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/vendo 
r/net/http/persistent.rb:628:in `start' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/vendo 
r/net/http/persistent.rb:570:in `connection_for' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/vendo 
r/net/http/persistent.rb:930:in `request' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/fetch 
er.rb:195:in `fetch' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/fetch 
er.rb:169:in `use_api' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/sourc 
e/rubygems.rb:223:in `block in remote_specs' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/sourc 
e/rubygems.rb:223:in `select' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/sourc 
e/rubygems.rb:223:in `remote_specs' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/sourc 
e/rubygems.rb:162:in `fetch_specs' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/sourc 
e/rubygems.rb:66:in `specs' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/defin 
ition.rb:192:in `block (2 levels) in index' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/defin 
ition.rb:189:in `each' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/defin 
ition.rb:189:in `block in index' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/index 
.rb:9:in `build' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/defin 
ition.rb:185:in `index' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/defin 
ition.rb:179:in `resolve' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/defin 
ition.rb:114:in `specs' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/defin 
ition.rb:109:in `resolve_remotely!' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/insta 
ller.rb:83:in `run' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/insta 
ller.rb:14:in `install' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/cli.r 
b:247:in `install' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/vendo 
r/thor/task.rb:27:in `run' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/vendo 
r/thor/invocation.rb:120:in `invoke_task' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/vendo 
r/thor.rb:344:in `dispatch' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/vendo 
r/thor/base.rb:434:in `start' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/bin/bundle:20:in 
`block in <main>' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/lib/bundler/frien 
dly_errors.rb:4:in `with_friendly_errors' 
     from E:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.0/bin/bundle:20:in 
`<main>' 
     Unfortunately, a fatal error has occurred. Please see the Bundler 
     troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! 

任何人都可以幫助我在這裏。我想學習rails,但我不知道這是什麼或者如何處理它。

回答

0

如果你看一下由Rails的產生的Gemfile,你會發現通過SSL連接到rubygems。

source 'https://rubygems.org'

這一行簡單地改變

source 'http://rubygems.org'

這不是在長期或部署系統一個偉大的想法,但它可以讓你和同時發行運行整理出來。

0

此錯誤discribed這裏:http://amitkazmirsky.com/2013/01/03/installing-rails-with-mysql-on-windows-8 實際上具有不同的解決方案sertificates,都有一座問題,試試這個:

修復SSL問題

「的OpenSSL :: SSL :: SSLError:所以SSL_connect返回= 1錯誤號= 0狀態的SSLv3 =讀服務器證書B:證書驗證失敗」

  1. 下載http://curl.haxx.se/ca/cacert.pem爲‘C:\ RailsInstaller \’

  2. 按下WindowsKey +'x',然後'y'(系統),在左邊選擇「高級系統設置」。

  3. 您正處於高級選項卡中。按下底部的「環境變量」按鈕。

  4. 在「系統變量」部分中,添加一個新的變量名「SSL_CERT_FILE」,值爲「C:\ RailsInstaller \ cacert.pem」

+0

我沒有使用railsinstaller,但我已經使用Windows安裝程序的紅寶石,我有一個Ruby200文件夾。我應該把它放在那裏嗎?編輯:它的工作,非常感謝你! – 2013-02-28 11:54:32