I’m using rvm with rails at work and when I cd into our project directory it automatically sets the gemset. I remember the first time I went into that directory I was asked if I wanted to use the specified gemset and of course I agreed, and from then on it just gets set. Here’s an example of what I mean:
-( codemonkey )-(~/maintenance)-
-(0)> go
/home/webpath/maintenance
Using /home/webpath/.rvm/gems/ruby-1.9.2-p136 with gemset webpath
-( codemonkey )-(~/maintenance)-
-(0)>
Now, I’ve been “practicing” installing and setting up RVM & Rails at home so that I can do it in my sleep (in case I move on to another RoR job and want to use RVM), but for the life of me I can’t get the above behavior. I have to cd into the project directory and then:
-( me )-(~/project)-
-(0)> rvm use 1.9.2@myproject
Before anyone beats up on me, the guy who originally got us on RVM left the company and I am trying to fill the void he left but this is a bit O’ goo I can’t figure out.
Any ideas?
To tie a particular Ruby to a directory, drop a
.rvmrcfile into that directory. You can then select the ruby version and gemset as follows.Leave the directory then re-enter it, you’ll be asked to confirm the RVM selection as you described in your question.
Full documentation: http://beginrescueend.com/workflow/rvmrc/