I have installed rvm after installing Mac OS Lion. The problem which I am facing is whenever I try to run a new Rails application, it gives me following error.
The problem gets resolved once choose a particular rvm. $ rvm gemset use global
I know about using .rvmrc file per project. But I don’t want to keep on using this command every time I create a demo project. Why doesn’t rvm uses the “global” gemset automatically every time I create new project?
I used this documentation to install rvm.
JP:demo3 jayparteek$ rails s
/Users/jayparteek/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:3:in `require': no such file to load -- action_dispatch (LoadError)
from /Users/jayparteek/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:3:in `<top (required)>'
from /Users/jayparteek/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:48:in `require'
from /Users/jayparteek/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:48:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
You can specify a “default” gemset for a given ruby interpreter, by doing:
See: http://beginrescueend.com/gemsets/using/ and http://beginrescueend.com/gemsets/basics/
it’s probably a better idea to use a specific gemset for each of your projects, together with it’s specific Gemfile. Problems could happen if you require ‘>= x.y.z’ in your Gemfiles, and you do a
bundle updatein one project, but not in the other…This way, although you update the gems in ProjectA via
bundle updateto the latest and greatest, they still don’t get modified for ProjectB — eliminating the possibility for interference between projects.you can also add a .rvmrc file to a directory, e.g. your project directory. RVM will then use the ruby-version and gem set listed in the .rvmrc file as the default for all sub-directories.
e.g. assuming that you have ruby 1.9.3 installed, and a gem set “rails_3.2” for that ruby version: