rails new project error cannot find railties

Hi,

I am getting an error while creating a new rails (3.2.3) project on mac os x lion with rvm (with jewelrybox gui) and ruby v 1.9.3 as default.

I tried gem install rails, gem install railties, and gem list does show rails and railties, both version 3.2.3 are present.

rails new myproject

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ 1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem railties (>= 0) (Gem::LoadError)   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/rubygems.rb:211:in `activate'   from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ ruby/1.8/rubygems.rb:1056:in `gem'   from /usr/bin/rails:18

I get the same error when I run rails -v.

ruby -v shows 1.9.3, but rails seems to be picking ruby framework version 1.8 above - is that the problem? If so, how can I get rails to use ruby 1.9.3 instead?

Thanks Anand

I found the answer here - ruby - Rails command line not found when installed with RVM - Stack Overflow

I should not use sudo while installing rails - that way, rvm manages a separate copy of gems for each version of ruby.