我正在尝试遵循 2011 年写的旧书。
因此,从 2011 年 11 月开始随机选择3.1.3版本。
如何在我的 RVM 中切换到该版本?
目前有Rails 4.0.0.beta1
版本...
请不要建议把它放在 Gemfile 中,因为还有很多其他的依赖关系,处理起来太麻烦了,因此如果我只是切换,我假设这意味着其他依赖关系将在也是同一时间,对吧?
更新
**-s-MacBook-Pro:agile **$ rails -v
Rails 4.0.0.beta1
**-s-MacBook-Pro:agile **$ gem install rails -v 3.1.3
Successfully installed rails-3.1.3
1 gem installed
**-s-MacBook-Pro:agile **$ rvm gemset create rails 313
gemset created rails => /Users/**/.rvm/gems/ruby-1.9.3-p392@rails
gemset created 313 => /Users/**/.rvm/gems/ruby-1.9.3-p392@313
**-s-MacBook-Pro:agile **$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin10.8.0]
**-s-MacBook-Pro:agile **$ rvm 1.9.3p392-head@rails313
Unknown ruby interpreter version: '1.9.3p392'.
**-s-MacBook-Pro:agile **$
再次更新
**-s-MacBook-Pro:agile **$ rvm gemset use 313
Using ruby-1.9.3-p392 with gemset 313
**-s-MacBook-Pro:agile **$ rails -v
/Library/Ruby/Site/1.8/rubygems/dependency.rb:296:in `to_specs': Could not find 'rails' (>= 0) among 2 total gem(s) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems/dependency.rb:307:in `to_spec'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/bin/rails:18
**-s-MacBook-Pro:agile **$