1

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.

5
  • 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. Commented Dec 12, 2012 at 10:14
  • 3
    have you tried installing the gems after rvm use? Commented Dec 12, 2012 at 10:16
  • @all: The gem is up-to date. The command 'rvm gemset list' shown as follows. gemsets for ruby-1.9.3-p327 => (default) global Commented Dec 12, 2012 at 10:21
  • I don't know why I have been down voted. Kindly furnish the reason so that I could make that better next time. Commented Dec 12, 2012 at 10:25
  • 2
    I mean have you installed rails gem after rvm use? try listing the local gems using gem list. Commented Dec 12, 2012 at 10:26

3 Answers 3

3

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

Sign up to request clarification or add additional context in comments.

4 Comments

can you please paste the output of this command "rvm list gemsets"
can you tell the output of "gem list" returned
*** LOCAL GEMS *** actionmailer (3.2.9) actionpack (3.2.9) activemodel (3.2.9) activerecord (3.2.9) activeresource (3.2.9) activesupport (3.2.9) arel (3.0.2) builder (3.0.4) bundler (1.2.3) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.4.0) erubis (2.7.0) execjs (1.4.0) hike (1.2.1) i18n (0.6.1) journey (1.0.4) jquery-rails (2.1.4) json (1.7.5) mail (2.4.4) mime-types (1.19) multi_json (1.5.0) mysql2 (0.3.11) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) rack-ssl (1.3.2) rack-test (0.6.2) rails (3.2.9) railties (3.2.9) rake (10.0.2) rdoc (3.12) sass (3.2.3) many more...
sass-rails (3.2.5) sprockets (2.2.2) thor (0.16.0) tilt (1.3.3) treetop (1.4.12) tzinfo (0.3.35) uglifier (1.3.0)
3

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.

Comments

2

Try passing --default to set the default ruby version

rvm use 1.9.3 --default 

2 Comments

But passing the default option is only required when you open a new terminal. There is nothing to do with default option as per as you are on the same terminal after executing rvm use. Right?
Hey, I have no problems with ruby instead the issue is with Rails after installing RVM. Hope you will suggest a good solution.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.