2016-03-16 91 views
0

我做了一些非常錯誤的事情,無法弄清楚我做了什麼或者它是如何發生的。我突然開始變得OpenSSL的證書錯誤:使用RVM在rails上安裝ruby問題

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed 

所以我跟着這個鏈接的方向求助:http://railsapps.github.io/openssl-certificate-verify-failed.html

在某些時候,我必須刪除軌道,因爲當我運行rails s我得到:

Rails is not currently installed on this system. To get the latest version, simply type: 

    $ sudo gem install rails 

現在,當我運行sudo gem install rails我得到一個錯誤:

<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 

然後只是試圖使這項工作的緣故,我嘗試重新安裝RVM:

$ \curl -L https://get.rvm.io | bash -s stable

但是,這給了我的問題很長的列表(我不明白......):

% Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 
100 184 100 184 0  0 847  0 --:--:-- --:--:-- --:--:-- 851 
100 22865 100 22865 0  0 53451  0 --:--:-- --:--:-- --:--:-- 114k 
Downloading https://github.com/rvm/rvm/archive/1.26.11.tar.gz 
Downloading https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc 
Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.26.11/1.26.11.tar.gz.asc', 
but no GPG software exists to validate it, skipping. 

Upgrading the RVM installation in /Users/cyrusghazanfar/.rvm/ 
    RVM PATH line found in /Users/cyrusghazanfar/.mkshrc /Users/cyrusghazanfar/.profile /Users/cyrusghazanfar/.bashrc /Users/cyrusghazanfar/.zshrc. 
    RVM sourcing line found in /Users/cyrusghazanfar/.profile /Users/cyrusghazanfar/.bash_profile /Users/cyrusghazanfar/.zlogin. 
    Installing rvm gem in 2 gemsetsError running 'command gem install /Users/cyrusghazanfar/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc', 
showing last 15 lines of /Users/cyrusghazanfar/.rvm/log/1458102835_ruby-2.1.0/gem.install.rvm->=1.11.3.9.log 
[2016-03-16 00:33:55] command 
current path: /Users/cyrusghazanfar/.rvm/src/rvm 
GEM_HOME=/Users/cyrusghazanfar/.rvm/gems/[email protected] 
PATH=/Users/cyrusghazanfar/.rvm/gems/[email protected]/bin:/Users/cyrusghazanfar/.rvm/rubies/ruby-2.1.0/bin:/Users/cyrusghazanfar/.rvm/bin:/Users/cyrusghazanfar/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin 
GEM_PATH=/Users/cyrusghazanfar/.rvm/gems/[email protected] 
command(7): command gem install /Users/cyrusghazanfar/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc 
+ ./scripts/functions/utility_logging : __rvm_log_dotted() 210 > gem install /Users/cyrusghazanfar/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 
Error running 'command gem install /Users/cyrusghazanfar/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc', 
showing last 15 lines of /Users/cyrusghazanfar/.rvm/log/1458102835_ruby-2.2.1/gem.install.rvm->=1.11.3.9.log 
[2016-03-16 00:33:55] command 
current path: /Users/cyrusghazanfar/.rvm/src/rvm 
GEM_HOME=/Users/cyrusghazanfar/.rvm/gems/[email protected] 
PATH=/Users/cyrusghazanfar/.rvm/gems/[email protected]/bin:/Users/cyrusghazanfar/.rvm/rubies/ruby-2.2.1/bin:/Users/cyrusghazanfar/.rvm/bin:/Users/cyrusghazanfar/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin 
GEM_PATH=/Users/cyrusghazanfar/.rvm/gems/[email protected] 
command(7): command gem install /Users/cyrusghazanfar/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc 
+ ./scripts/functions/utility_logging : __rvm_log_dotted() 210 > gem install /Users/cyrusghazanfar/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 
. 
    Installing gem-wrappers gem in 2 gemsetsError running 'command gem install /Users/cyrusghazanfar/.rvm/gem-cache/gem-wrappers-1.2.7.gem --local --no-ri --no-rdoc', 
showing last 15 lines of /Users/cyrusghazanfar/.rvm/log/1458102835_ruby-2.1.0/gem.install.gem-wrappers->=1.2.7.log 
[2016-03-16 00:33:55] command 
current path: /Users/cyrusghazanfar/.rvm/src/rvm 
GEM_HOME=/Users/cyrusghazanfar/.rvm/gems/[email protected] 
PATH=/Users/cyrusghazanfar/.rvm/gems/[email protected]/bin:/Users/cyrusghazanfar/.rvm/rubies/ruby-2.1.0/bin:/Users/cyrusghazanfar/.rvm/bin:/Users/cyrusghazanfar/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin 
GEM_PATH=/Users/cyrusghazanfar/.rvm/gems/[email protected] 
command(7): command gem install /Users/cyrusghazanfar/.rvm/gem-cache/gem-wrappers-1.2.7.gem --local --no-ri --no-rdoc 
+ ./scripts/functions/utility_logging : __rvm_log_dotted() 210 > gem install /Users/cyrusghazanfar/.rvm/gem-cache/gem-wrappers-1.2.7.gem --local --no-ri --no-rdoc 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 
Error running 'command gem install /Users/cyrusghazanfar/.rvm/gem-cache/gem-wrappers-1.2.7.gem --local --no-ri --no-rdoc', 
showing last 15 lines of /Users/cyrusghazanfar/.rvm/log/1458102835_ruby-2.2.1/gem.install.gem-wrappers->=1.2.7.log 
[2016-03-16 00:33:55] command 
current path: /Users/cyrusghazanfar/.rvm/src/rvm 
GEM_HOME=/Users/cyrusghazanfar/.rvm/gems/[email protected] 
PATH=/Users/cyrusghazanfar/.rvm/gems/[email protected]/bin:/Users/cyrusghazanfar/.rvm/rubies/ruby-2.2.1/bin:/Users/cyrusghazanfar/.rvm/bin:/Users/cyrusghazanfar/anaconda/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin 
GEM_PATH=/Users/cyrusghazanfar/.rvm/gems/[email protected] 
command(7): command gem install /Users/cyrusghazanfar/.rvm/gem-cache/gem-wrappers-1.2.7.gem --local --no-ri --no-rdoc 
+ ./scripts/functions/utility_logging : __rvm_log_dotted() 210 > gem install /Users/cyrusghazanfar/.rvm/gem-cache/gem-wrappers-1.2.7.gem --local --no-ri --no-rdoc 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 
. 
    Regenerating gem wrappers in 2 rubies<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 
<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError) 
    from <internal:gem_prelude>:1:in `<compiled>' 
. 
Upgrade of RVM in /Users/cyrusghazanfar/.rvm/ is complete. 

# cyzanfar, 
# 
# Thank you for using RVM! 
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!! 
# 
# ~Wayne, Michal & team. 

In case of problems: http://rvm.io/help and https://twitter.com/rvm_io 

Upgrade Notes: 

    * No new notes to display. 

請幫我調試一下。

UPDATE

添加OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONEconfig/environments/development.rb解決了這個問題,但我需要做的,對於每一個應用程序,我建?有沒有辦法全局配置OpenSSL證書?

+1

不知道你的問題是什麼。我最後一次遇到RVM問題時,有人建議將它解壓,即將其刪除並重新安裝。這對我有效。你只需要說'implode rvm'。這裏有一個隨機鏈接,我只是用內嵌的rvm來搜索:https://gauravsohoni.wordpress.com/2014/01/01/rvm-implode-and-rvm-install/。希望這可以幫助!乾杯。 – user273072545345

回答

0

您可能安裝了兩個ruby版本。檢查使用:

which -a ruby 

刪除紅寶石的所有版本,使用包管理器重新安裝一個,然後重新安裝RubyGems的。