RVM is not working over SSH

前端 未结 10 1557
时光取名叫无心
时光取名叫无心 2020-12-25 13:05

RVM is not working over SSH.

At the command-line:

leifg@host:~$ which ruby
/usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby

Connected

10条回答
  •  轮回少年
    2020-12-25 13:47

    “rvm” has two invocation bugs: the default installation drops the file /etc/profile.d/rvm.sh and believes any bash trick is now globally available. – This assumption is wrong.

    Files in /etc/profile.d/ are “sourced” on login, but maybe not from bash, maybe not even from a shell. So the cd hook it installs is not there after the shell which runs these files exits. Actually, because of the buggy way “rvm” installs this hook, it is already gone once you run naked bash in a login-shell!

    I don’t know if “rvm” supports an explicit invocation for virtual environments, without relying on cding into some directory (that I consider the second bug).

    There is one sane workaround:

    Make your shell source /etc/profile.d/rvm.sh from e.g. ~/.bashrc. .bashrc is executed from any non-login bash, and login-bash is usually setup to source .bashrc from those login-shell files like ~/.profile

    For your ssh problem: should a proper ssh-shell not be login-shell anyway?

提交回复
热议问题