2

I installed rvm, like you're supposed to do (apparently), avoiding apt-get to handle my ruby installations (as @btelles points out here: https://stackoverflow.com/questions/2225881/passenger-installation-with-nginx-fails)

However, I can only see rvm when I log in remotely via ssh. When I log in locally, there's no indication of rvm anywhere on the system. When I type into a terminal when logged in locally:

which rvm

The result is nothing. When I run the same thing from the command line remotely via ssh, I get:

xxx@xxxx:~$ which rvm
/usr/local/rvm/bin/rvm

What should I do to get ruby running from the local machine?

EDIT: started a bounty because I REALLY need this to be solved. Ubuntu should play nice with rvm in rvm's default installation, and the fact that it does not is extremely frustrating, to say the least.

2 Answers 2

2
+50

While I don't know why it's doing this, I know how to fix it:

This is a path issue. You need to add the following to the files /etc/bash.bashrc and ~/.bashrc:

PATH=$PATH:PATH=$PATH:/usr/local/rvm/bin

You'll need to use 'sudo' privileges in order to do that for /etc/bash.bashrc, it's a protected file.

Also, you should report this bug (since I'm pretty sure that's what it is) here on RVM's Github project.

6
  • but! why does it work from ssh, and why isn't this automatically the default?
    – mmr
    Sep 13, 2011 at 18:13
  • 1. No idea. 2. The RVM install doesn't handle $PATHs for you. You have to add those manually. The reason why RVM doesn't handle that is because it's used on everything - Fedora, Ubuntu, Mac, openSUSE, Debian, you name it it's got RVM, and adding the path automatically as part of the install process is rather difficult (to say the least).
    – jrg
    Sep 13, 2011 at 18:15
  • I guess my concern has to do with breaking things. Last time I upgraded ubuntu from 9 to 11, scponly broke. Now, rvm is 'broken', in the sense that it works fine when I log in remotely, but the same paths aren't used when I log in locally. I'd call that seriously, seriously broken. Do I get any kind of guarantee that a year and a half from now, the paths won't have migrated again? How can this kind of system be deployed on any kind of enterprise scale?
    – mmr
    Sep 13, 2011 at 18:19
  • Can I invite you to the chatroom so we can discuss this? :)
    – jrg
    Sep 13, 2011 at 18:22
  • 2
    ssh uses login shell and rvm adds itself to .bash_profile, check for more info here: rvm.beginrescueend.com/support/faq/#shell_login
    – mpapis
    Feb 1, 2012 at 21:32
0

/usr/local/ isnt the default binary path in Ubuntu. I think it's a path problem, somehow your SSH connected shell has a different path variable.

echo $PATH
1
  • What is the default binary path? I guess more philosophically, why buck the standard trend and have a different default, making it more difficult to use the same libraries as everyone else? Should I be modifying my $PATH to include /usr/local?
    – mmr
    Sep 9, 2011 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .