23

I'm having some problems with my project. I keep an .rvmrc in my project's directory with the following config:

rvm use 1.9.2

and I put the following lines into my ~/.zshrc:

rvm_project_rvmrc=1
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm

Yet whenever I cd into my project's directory, ruby -v shows ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0].

What am I missing here?

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
pkazmierczak
  • 853
  • 2
  • 11
  • 13

4 Answers4

54

Another thing could be that rvm doesn't trust your rvmrc. Please trust it manually again with

rvm rvmrc trust DIR

iltempo
  • 15,718
  • 8
  • 61
  • 72
9

After an update, RVM seemed to be ignoring all my .rvmrc files. I eventually got it to work by running

rvm reload
KurtPreston
  • 1,062
  • 14
  • 28
2

Are you sure rvm is loaded correctly? According to the docs

type rvm | head -1

should show

rvm is a function

The rvm script referenced in you ~/.zshrc is only executed if it exists. Otherwise it's skipped silently.

iltempo
  • 15,718
  • 8
  • 61
  • 72
  • Thats how it supposed to be. Does the rvm use 1.9.2 command work when executed manually? Is the ruby switched then? – iltempo Feb 18 '12 at 13:11
  • Another thing could be that rvm doesn't trust your rvmrc. Please try tu trust it manually again with 'rvm rvmrc trust DIR'. – iltempo Feb 18 '12 at 13:56
  • I added it again as an answer to not hide it in the comments. – iltempo Feb 19 '12 at 09:24
  • According to the rvm docs, the test string should be `type rvm | head -n 1` – Jarret Raim Aug 13 '12 at 22:41
  • 1
    hmmm... I'm getting `rvm is hashed` instead. Is that something it can also show? Or does that mean there's something wrong? – Hengjie Jan 23 '13 at 11:17
2

Setting rvm_project_rvmrc=1 probably only works within your .zshrc, try exporting it to the environment: export rvm_project_rvmrc=1

Joshua Cheek
  • 30,436
  • 16
  • 74
  • 83