RVM/rbenv 关于 Linode 上 RVM 的奇怪问题,每次 ssh 登陆服务器后,发现 rvm 并未选择 ruby 版本,即使上次登陆的时候`rvm --default use ree`

geekontheway · 2011年12月07日 · 最后由 geekontheway 回复于 2012年02月04日 · 5066 次阅读

如题。不过另一台 linode 上的 rvm 工作正常。

@update at 10:56

另外一台 linode 也是这样

.......

root@li389-178:~# rvm list

rvm rubies

   ree-1.8.7-2011.03 [ i686 ]

root@li389-178:~# ruby --version
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2011.03


root@li380-16:~# rvm list

rvm rubies

   ruby-1.9.2-p290 [ i386 ]
   ree-1.8.7-2011.03 [ i386 ]

root@li380-16:~# which rvm
/usr/local/rvm/bin/rvm
root@li380-16:~# which ruby
/usr/local/rvm/bin/ruby
root@li380-16:~# ruby --version
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2011.03

你搞错了吧。。是 rvm ree --default

#1 楼 @ywencn

== Usage

  rvm [Flags] [Options] Action [Implementation[,Implementation[,...]]

== Flags

  --default     - with 'rvm use X', sets the default ruby for new shells to X.
  --debug       - Toggle debug mode on for very verbose output.
  --trace       - Toggle trace mode on to see EVERYTHING rvm is doing.
  --force       - Force install, removes old install & source before install.
  --summary     - Used with rubydo to print out a summary of the commands run.
  --latest      - with gemset --dump skips version strings for latest gem.
  --gems        - with uninstall/remove removes gems with the interpreter.
  --docs        - with install, attempt to generate ri after installation.
  --reconfigure - Force ./configure on install even if Makefile already exists.

@ywencn

root@li389-178:~# rvm ree --default
root@li389-178:~# rvm list

rvm rubies

=> ree-1.8.7-2011.03 [ i686 ]

root@li389-178:~# exit
logout
Connection to log.networking.io closed.
blackmac001:~ bill$ ssh [email protected]
Welcome to Ubuntu 11.10 (GNU/Linux 3.0.4-linode38 i686)

 * Documentation:  https://help.ubuntu.com/
Last login: Wed Dec  7 01:34:37 2011 from 182.18.65.14
root@li389-178:~# rvm list

rvm rubies

   ree-1.8.7-2011.03 [ i686 ]

你有设置 .bashrc 吗?

#4 楼 @huacnlee 看了一下居然都没有$HOME/.rvm/scripts/rvm,rvm 是安装/usr/local/rvm,所以我要

echo '[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm"' >> .bashrc;
source .bashrc;

是吧?多谢啊

#6 楼 @huacnlee 还是不能工作,看来要重装一遍 rvm

#7 楼 @geekontheway 看看 /etc/rvmrc 加上

export rvm_path=/usr/local/rvm

#8 楼 @doitian env 里 rvm_path=/usr/local/rvm 已经是这样了,谢谢哈

需要 登录 后方可回复, 如果你还没有账号请 注册新账号