nonopolarity
nonopolarity

Reputation: 150966

Given any Ruby on Rails project folder, can you tell it was Rails 2.3.5 and Ruby 1.8.7 that was used for the project?

So that if you have a Ruby Version Manager, then you can switch to that mode first before altering the project files. (probably best)

Upvotes: 0

Views: 123

Answers (1)

Dave Pirotte
Dave Pirotte

Reputation: 3816

You can set an .rvmrc file in your project directory, so that you will automatically change to a particular ruby and gemset when you enter the directory. Check out the rvmrc docs for details.

This method doesn't infer versions from the project files, though. If you really wanted to infer Rails version you could put a little script in your .rvmrc file:

RAILS_VERSION=`ruby -e "require 'config/environment'; puts RAILS_GEM_VERSION"`

Upvotes: 1

Related Questions