Using RVM, Rails 3.0.7 is messed up after installing Rails 3.1.0 beta1
Using rvm I installed and am using Ruby 1.9.2p180.
I created a gemset called rails3tutorial and, using it, installed Rails 3.0.7, created "sample_app", then used bundle to install. Very nice.
Then I created a new gemset called rails310b1, installed Rails 3.1.0 Beta 1, created an app, and bundle install'd...but it turned out I was not actually switched to the rails310b1 gemset, and so I ended up installing to ruby-1.9.2p180's default gemset (is that @global?...). I then manually deleted all the gems that had been installed!
Then I switched to rails310b1, and bundle install'd, created an app, fired up the app -- golden.
Now I switch back to the rails3tutorial gemset, and cd to the app created using it, and I get errors when running rails commands like..开发者_如何转开发.
$ rails generate integration_test layout_links
/Users/paul/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/bin/rails:19:in `load': no such file to load -- /Users/paul/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rails-3.1.0.beta1/bin/rails (LoadError)
from /Users/paul/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/bin/rails:19:in `<main>'
It's looking for /Users/paul/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rails-3.1.0.beta1/bin/rails but why?! $PATH looks fine.
Any suggestions as to what is messed up and how to clean this up, or is it best if I wipe out all my gems/gemsets and start over?...
Thanks!
There is nice screencast with basics of RVM http://screencasts.org/episodes/how-to-use-rvm but it mostly comes to using rubies:
rvm install 1.9.3
cd ~/projects/my-app
touch Gemfile
rvm use --create --rvmrc 1.9.3@rails32
gem install bundler rails
bundle exec rails new .
bundle install
bundle exec rails generate integration_test layout_links
please note you need to prefix most of the commands with bundle exec
there is my gem that should save you from this problem rubygems-bundler.
also make sure you use .rvmrc
files for every project so when you switch dir in console the proper ruby environment is set, the --rvmrc
switch used above will generate one for you.
精彩评论