2013-01-07 48 views
-1

升級到Rails 3.2和Rubygems時,出現錯誤消息。正如在stackoverflow建議,我跑了gem update --system升級Rubygems到1.8.24。在此更新之後,我運行了一條簡單的rails s命令,並且我運行的每個命令都會出現此持續性錯誤。Rubygems,gemspec,可能的rvm錯誤

我RVM的版本是:1.17.7

我的Ruby版本是:ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin11.3.0]

當我運行bundle install,我得到一個錯誤:

"Could not find twitter-1.6.0 in any of the sources" 

當我運行rails -v,我得到一個錯誤:

could not find rack-1.2.3. run bundle install. 

我想我很在某些時候也可以用sudo命令安裝寶石,這可能會讓我的流程搞砸。有沒有辦法檢查?或糾正?

Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/actionmailer-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d85b5f0> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/actionpack-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d93d6a8> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activemodel-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d89b5b0> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activerecord-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d9ddc48> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activeresource-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d9cdca8> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/rails-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d908d68> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/railties-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8c034468> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/actionmailer-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d85b5f0> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/actionpack-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d93d6a8> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activemodel-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d89b5b0> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activerecord-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d9ddc48> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activeresource-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d9cdca8> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/rails-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d908d68> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/railties-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8c034468> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/actionmailer-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d85b5f0> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/actionpack-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d93d6a8> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activemodel-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d89b5b0> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activerecord-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d9ddc48> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activeresource-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d9cdca8> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/rails-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d908d68> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/railties-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8c034468> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/actionmailer-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d85b5f0> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/actionpack-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d93d6a8> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activemodel-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d89b5b0> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activerecord-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d9ddc48> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/activeresource-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d9cdca8> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/rails-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8d908d68> 3.2.0"] 
Invalid gemspec in [/Users/jdo/.rvm/gems/ruby-1.9.2-p320/specifications/railties-3.2.0.gemspec]: Illformed requirement ["#<Syck::DefaultKey:0x007fad8c034468> 3.2.0"] 
script/rails:6:in `require': no such file to load -- rails/commands (LoadError) 
    from script/rails:6:in `<main>' 

回答

1

如果您認爲您安裝使用sudo你的Rails,試試:

ls -al ~ | grep .rvm 

~$HOME快捷,所以該命令將列出你的home目錄,管道輸出到grep將搜索對於包含.rvm的列表。

您的.rvm文件夾應該歸您所有,看起來像列表中的rdo staff。我們希望將您的用戶ID和組值(默認爲staff)同時告知系統,讓您成爲.rvm目錄中所有文件的所有者。

sudo chown +r jdo:staff ~/.rvm 

這將遞歸下降到.rvm並重置文件和文件夾的所有權回到你們的一切RVM目錄裏面的內容,包括已安裝的紅寶石和他們的寶石。

請不要在驅動器上執行該命令,否則系統會變得非常不安,但是對於那個目錄,或者你認爲應該屬於你的用戶的那個命令,那就是......當您拉動扳機時,請小心指向正確的目錄。