I work on Rails as a contractor as well as my own projects. My main contract uses rails 2.x and ruby ree 1.8.7. Naturally, I like to use the bleeding edge on my own projects. This causes me problems going back and forth. I found that you can create an .rvmrc file that will set the environment for you when you run ruby in that directory.
You just put the same command you would normally type at the prompt to switch RVM environments in the .rvmrc file and it works!
echo "rvm ree@global" > .rvmrc
This will enable you to simply change directories and not have to think about which version of ruby and gemset you are using. cd into that directory, type ruby –version to verify it loading the right ruby version.
Post a Comment