2012-01-22 423 views
3

我剛剛在我的Ubuntu系統上安裝了Ruby on Rails所需的一切。但是,當我使用rails命令,它輸出這些錯誤:如何解決Rails安裝錯誤?

[email protected]:/var/lib/gems/1.8/specifications# rails -v 
Invalid gemspec in [/var/lib/gems/1.8/specifications/activemodel-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0xb632551c> 3.2.0"] 
Invalid gemspec in [/var/lib/gems/1.8/specifications/activerecord-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0xb61ac1b8> 3.2.0"] 
Invalid gemspec in [/var/lib/gems/1.8/specifications/activeresource-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0xb62d399c> 3.2.0"] 
Invalid gemspec in [/var/lib/gems/1.8/specifications/actionpack-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0xb6249abc> 3.2.0"] 
Invalid gemspec in [/var/lib/gems/1.8/specifications/railties-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0xb62cda38> 3.2.0"] 
Invalid gemspec in [/var/lib/gems/1.8/specifications/actionmailer-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0xb62d97e8> 3.2.0"] 
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z" 
Invalid gemspec in [/var/lib/gems/1.8/specifications/rails-3.2.0.gemspec]: Illformed requirement ["#<YAML::Syck::DefaultKey:0xb616b690> 3.2.0"] 
/usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:926:in `report_activate_error': Could not find RubyGem railties (>= 0) (Gem::LoadError) 
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:244:in `activate_dep' 
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:236:in `activate' 
    from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1307:in `gem' 
    from /usr/local/bin/rails:18 

我該如何解決這個問題?

+0

永不放棄!堅持下去!你可以打敗這個問題,因爲你有能力和聰明。 – jaydel

回答

3

我會建議使用,而不是發行的Ruby版本管理器,比如RVM,安裝Ruby紅寶石+寶石:http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

+0

我安裝了RVM,通過RVM安裝了Ruby 1.9.2,然後使用了gem install rails來安裝Rails – ItsGreg

+0

然後很奇怪的Ruby在/ var/lib/gems中搜索你的gem。如果你使用的是RVM,rails應該位於你的gemset中。 「which rails」命令應該指向/home/your_user/.rvm/gems/..../bin/rails – Jef

+0

+1來建議RVM。我永遠不會做任何事情Railsy w/o它 – jaydel

相關問題