Skip to content

Instantly share code, notes, and snippets.

@wayneeseguin
Created June 15, 2010 13:13
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 20 You must be signed in to fork a gist
  • Save wayneeseguin/439102 to your computer and use it in GitHub Desktop.
Save wayneeseguin/439102 to your computer and use it in GitHub Desktop.
This is an example of using RVM's Project .rvmrc file
to have it automatically bootstrap your environment, including bundler.
This could be further expanded to do anything you require :)
The important thing to remember is that the purpose of these files is
to allow you to very easily have your 'project context' (aka 'environment')
loaded automatically for you when you enter the project in the shell (cd).
You can generate the .rvmrc file below by running:
rvm --create --rvmrc use 1.9.2
# Project specific .rvmrc file
if [[ -s "/Users/wayne/.rvm/environments/ruby-1.9.2-preview3" ]] ; then
. "/Users/wayne/.rvm/environments/ruby-1.9.2-preview3"
else
rvm --create use "ruby-1.9.2-preview3"
fi
[[ -s "project_name.gems" ]] && rvm gemset import project_name.gems
bundle install
gem "haml"
gem "compass"
@stve
Copy link

stve commented Jun 24, 2010

Wayne, this is awesome. I've added it to my workflow and to make it a little easier, created a gem that will generate a .gems file, Gemfile and .rvmrc file for a given project.

http://github.com/spagalloco/rvmify

@wayneeseguin
Copy link
Author

Small note, if you omit the term 'use' it will silently use the ruby for slightly less output.
We still have yet to add a --quiet flag for RVM ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment