EasierSaidThanDone
EasierSaidThanDone

Reputation: 1897

Cannot install rails gem

Somehow my rails installation hides itself successfully...

I have:

ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
rvm 1.10.0-pre 
gem 1.8.10

and I try to install rails:

sudo gem install rails

it works fine:

Successfully installed rails-3.1.3
1 gem installed
Installing ri documentation for rails-3.1.3...
Installing RDoc documentation for rails-3.1.3...

when I do:

rails - v

I get

The program 'rails' is currently not installed.  You can install it by typing:
sudo apt-get install rails

Also, when I do

rake

in a rails app root directory, I get:

Missing the Rails  gem. Please `gem install -v= rails`, update your 
RAILS_GEM_VERSION setting in config/environment.rb for the Rails version 
you do have installed, or comment out RAILS_GEM_VERSION to use the 
latest version installed.

executing

gem install -v= rails

raises an error:

ERROR:  While executing gem ... (ArgumentError)
Illformed requirement ["="]

So apparently it is sitting somewhere and cannot be seen by my environment. I guess installing via apt-get is not an option as I don't want to confuse gem...

Any ideas? Cheers Mac

Upvotes: 1

Views: 2380

Answers (2)

andrers52
andrers52

Reputation: 554

Use RVM instead of the packaged ruby/gems distribution. http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

Upvotes: 1

Nerian
Nerian

Reputation: 16197

Do not use sudo.

Just gem install rails

Upvotes: 7

Related Questions