The simple (if a little weird and not particularly well documented) answer is that you can pass the version number as the first parameter, surrounded by underscores like this:
rails _1.2.3_ -v => Rails 1.2.3 rails _2.1.0_ -v => Rails 2.1.0
If you specify a version that you don’t have installed you’ll get a gem activation error, like this:
/Library/Ruby/Site/1.8/rubygems.rb:636:in `report_activate_error': RubyGem version error: rails(1.2.6 not = 2.5.0) (Gem::LoadError) from /Library/Ruby/Site/1.8/rubygems.rb:141:in `activate' from /Library/Ruby/Site/1.8/rubygems.rb:49:in `gem' from /usr/bin/rails:18


Leave a reply
You can use Markdown in your comment as well as plain HTML. You can use
<filter:jscode lang="ruby">and</filter:jscode>tags to surround code blocks (supported languages are css, html, javascript and ruby). Your email address will not be published.If your comment doesn’t appear immediately after posting it could have been marked as spam. Don’t worry: we regularly check for and approve incorrectly filtered comments so you shouldn’t have to wait too long for it to be shown.