[LRUG] Rails/RVM path confusion

gvim gvimrc at gmail.com
Sat Sep 21 14:35:24 PDT 2013


I install Ruby 2.0.0 and Rails 4.0.0 via RVM on OS X 10.8 in my standard 
user account. Fine. I check my `ruby` and `rails` are both coming from 
the right place. Good so far:

/Users/<me>/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
/Users/<me>/.rvm/rubies/ruby-2.0.0-p247/bin/rails

Next, I create my first Rails app with `rails new r1` and inside the new 
r1 app directory I setup my .rvmrc with `rvm --rvmrc --create 2.0.0 at r1` 
but `which rails` now returns  /usr/local/rails so I check my $PATH and 
discover that:

/Users/<me>/.rvm/rubies/ruby-2.0.0-p247/bin

... had now become

/Users/<me>/.rvm/rubies/ruby-2.0.0-p247 at global/bin

... which explains why my newly installed rails binary can't be found

So, 2 questions:

1. Why has my rails path become screwed? Must I REALLY have a new PATH 
entry for every Rails app I create?
2. What magic is Ruby/Rails/RVM using to alter my PATH because ~/.bashrc 
doesn't contain everything in $PATH and ~/.bash_profile only contains:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

gvim



More information about the Chat mailing list