1
votes

I had the Rails 3.2.9 installed before I did the following.

I installed RVM using the command 'curl -L https://get.rvm.io | bash -s stable --ruby' referring https://rvm.io/rvm/install/

Then ruby 1.8.7 and 1.9.3 were installed using command rvm install [x]' ([x] stands the version) and I set ruby 1.9.3 as default using the command 'rvm use 1.9.3 --default'. Earlier I was using '1.8.7' which was installed before installing RVM. Now when I type 'rails -v' in the command prompt I am getting the following error.

/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:247:in to_specs': Could not find railties (>= 0) amongst [bundler-1.2.3, rake-10.0.2, rubygems-bundler-1.1.0, rvm-1.11.3.5] (Gem::LoadError) from /usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:256:into_spec' from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1208:in `gem' from /usr/local/bin/rails:18

Please help me to resolve the same. Good responses will always be appreciated.

3
rvm use 1.9.3 --default will set the default ruby version for new shells. Check with rvm list. Did you create a gemset or install rails to the global gemset? Check what gemset you are using with rvm gemset list.Patrik Björklund
have you tried installing the gems after rvm use?maximus ツ
@all: The gem is up-to date. The command 'rvm gemset list' shown as follows. gemsets for ruby-1.9.3-p327 => (default) globalRajesh Omanakuttan
I don't know why I have been down voted. Kindly furnish the reason so that I could make that better next time.Rajesh Omanakuttan
I mean have you installed rails gem after rvm use? try listing the local gems using gem list.maximus ツ

3 Answers

3
votes

since you are using rvm you need to install rails 3.2.9 before doing rails -v try this command

gem install rails -v 3.2.9

and then try rails -v

3
votes

From the Question itself it is known that the issue is with some of the gem dependencies. So after setting up RVM, I updated the gems and installed rails using gem command once again. Then restarted the terminal. Wow, It works!! 'rails -v' outputs Rails 3.2.9.

One more thing I want to tell you that if you are using bash, just execute the command '/bin/bash --login' before setting the default ruby version. Otherwise it will throw the error shown below.

'RVM is not a function, selecting rubies with 'rvm use ...' will not work.'

Thanks for all your responses.

2
votes

Try passing --default to set the default ruby version

rvm use 1.9.3 --default