Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I cannot get rvm to read my project specific .rvmrc

Tags:

rvm

I come in peace (re: rbenv) but I am super frustrated with rvm & .rvmrc. I keep on running into issues where I cd into my project folder only to find that my ruby & gemset environment has not been set correctly. So can someone once and for all tell me how to create a proper .rvmrc for my project.

I have tried both ways that I know of:

  1. creating a .rvmrc and putting 'rvm use 1.9.2@GEMSET' in there (this works sometimes and sometimes not)
  2. using the rvm --create --rvmrc 1.9.2@GEMSET command line tool which creates a more ellaborate .rvmrc but cd'ing into my project folder is still not giving me the desired result.

This problem is erratic. I will say that I am working on two different machines and syncing my project folder via Dropbox. So could this be a problem where rvm cannot verify the folder and therefore ignores the .rvmrc?

Any help will be greatly appreciated.

like image 887
Etienne Avatar asked Aug 24 '11 18:08

Etienne


2 Answers

Every time you enter a project directory after changing its .rvmrc file, rvm will prompt you for accepting or not the new file. If you want to change your decision afterwards, you should use rvm rvmrc command:

rvm rvmrc {trust,untrust,trusted,load,reset}
like image 83
Guilherme Garnier Avatar answered Dec 06 '22 13:12

Guilherme Garnier


You may need to set

rvm_project_rvmrc=1

in your shell config before the rvm scripts are sourced, e.g.:

rvm_project_rvmrc=1
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
like image 40
tvon Avatar answered Dec 06 '22 15:12

tvon