Specifying Rails Version

2020-02-12 23:28发布

问题:

I decided to upgrade to Ruby 2.0.0 and Rails 4.0.0. I'm trying to set these as my default programs, by using this line:

rvm use 2.0.0@rails-4.0.0 --default

I get the error

Failed to load /Users/michaeldunnegan/.gemrc because it doesn't contain valid YAML hash

My .gemrc file is blank. I don't know what to do. I can't find any references at all.

回答1:

most likely it is not empty, there is a lot of UTF-8 characters that editor will not show you, just remove the file before continuing:

rm -f /Users/michaeldunnegan/.gemrc


回答2:

You need to make a gemset first:

rvm --default use 2.0.0
rvm gemset create rails-4.0.0
rvm use 2.0.0@rails-4.0.0 --default
gem install rails

I think that is right.