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

StackOverflow https://stackoverflow.com/questions/21195238

  •  29-09-2022
  •  | 
  •  

문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top