Reputation: 150966
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
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