How to use .rvmrc or .ruby-version / .ruby-gemset w/ new terminal window that's ALREADY in project dir?

387 views Asked by At

Quick question for you guys:

According to the RVM docs, using an .rvmrc or .ruby-version / .ruby-gemset files...

This will be set when entering project directory 

My question is, in OSX, you have the ability to Cmd-T to open a new Terminal tab, and when doing that, the directory is already set to the previous directory (which, in my case, is the project dir).

When doing this, I'm not changing into the project directory (thus triggering rvm to use the project settings), I'm alredy in the project dir, so RVM is picking up the global defaults, which is different.

So I've found myself having to cd ~ then cd project in order to go out then back into the directory and get rvm to play nice.

Any way to skip that? Seems like an extra step and somtimes I forgot to do it when quickly opening up terminals, and thus am working with the wrong ruby version and gemset.

2

There are 2 answers

1
mpapis On BEST ANSWER

try again after:

rvm get stable

I was just fixing similar problem in RVM 1.25.15 ...

although if you use system installation of rvm this is not fixable.

0
Rafael_Mancini On

Some times the accepted answer may not work. In my case, I had to add the command cd . to the .profile file in the root folder if you don't use zsh. If you do, add it to the '.zlogin' file in the root folder.