3

I just installed everything needed for Ruby on Rails on my Ubuntu system. But, when I use the rails command, it outputs these errors:

root@laptop3:/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

How do I fix this?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Gregor Menih
  • 5,036
  • 14
  • 44
  • 66
  • Never give up! Persevere! You can defeat the issue because you are empowered and intelligent. – jaydel Jan 22 '12 at 17:03

1 Answers1

3

I would advice to install Ruby + Ruby Gems using a version manager, such as RVM, instead of the distro Ruby : http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

Jef
  • 5,424
  • 26
  • 28
  • I installed RVM, installed Ruby 1.9.2 via RVM and then used gem install rails, to install Rails – Gregor Menih Jan 22 '12 at 17:02
  • Then it's weird Ruby searches your gems in /var/lib/gems. If you're using RVM, rails should be located in your gemset. The "which rails" command should point to /home/your_user/.rvm/gems/..../bin/rails – Jef Jan 22 '12 at 17:03
  • @GregaMenih Did you `rvm use` the version you want? You can also set the default. – Dave Newton Jan 22 '12 at 17:08
  • Yes, I used rvm use. Anyhow, I think the problem might be, that I used apt-get install rails prior to installing anything, about a month ago. Trying to resolve – Gregor Menih Jan 22 '12 at 17:25
  • 1
    Yes. The problem was, that I was trying to install RoR about a month ago, so I just used 'sudo apt-get install rails', and never removed it. Thanks for your help :) – Gregor Menih Jan 22 '12 at 17:31