Creating an older rails project with multiple (newer) versions installed

I have been studying rspec the last week or two and have been using Rail 2.1.2 to do my exploring.  I was finally ready to jump into some legacy code and couldn’t even create a spec folder on the directory tree because the version of rails was older:

  1: user$ ruby script/generate rspec
  2: Cannot find gem for Rails ~>
  3:     Install the missing gem with 'gem install -v=1.2.3 rails', or
  4:     change environment.rb to define RAILS_GEM_VERSION with your desired version. 

After looking at the rails file in /usr/bin, I noticed the regex was looking for something that matched the following regex string:

  1: /^_(.*)_$/

If my recollection holds, that means I’m looking for any character set that begins and ends with underscores (i.e., _1.x.x).

So I tried the following:

  1: rails _1.2.3_ <projectname>

and it succeeded.

Hope this helps someone else. Continuing my Ruby journey.

I’m also looking at Fluent NHibernate now, so it’s going to be a few couple weeks.

About Jason Meridth

Continuously learning software developer trying to not let best be the enemy of better
This entry was posted in rspec, ruby. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

One Response to Creating an older rails project with multiple (newer) versions installed

  1. bubba says:

    hey, that helped me. thanks!