安装ruby一定要注意的一步(ruby -v和 rbenv version结果不一致)

寻技术 Ruby编程 2023年07月11日 92

https://github.com/rbenv/rbenv#installation

安装ruby的第三步

Run ~/.rbenv/bin/rbenv init for shell-specific instructions on how to initialize rbenv to enable shims and autocompletion.

 

[webuser@iZ94aiq7f6cZ history-book]$ ~/.rbenv/bin/rbenv init
# Load rbenv automatically by appending
# the following to ~/.bash_profile:

eval "$(rbenv init -)"

注意:这句话需要手动添加到~/.bash_profile中,用指令执行后只在当前窗口生效



[webuser@iZ94aiq7f6cZ ~]$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
[webuser@iZ94aiq7f6cZ ~]$ rbenv versions
  system
* 2.3.0 (set by /home/webuser/.rbenv/version)

关闭

用微信“扫一扫”