rvm(ruby version manage)安装

参考:http://rvm.beginrescueend.com/rvm/install/

1. 安装方法有两种:

方法一:从github中下载按照

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

 方法二:

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )

2. 然后输入:

$ type rvm | head -1

如果显示为:

rvm is a function

则表示安装成功。

3. 之后:

source ~/.rvm/scripts/rvm

如果在第二步输入后未显示rvm is a function则表示出错。

 解决办法:

1. 修改~/.bashrc

[ -z "$PS1" ] && return

修改为:

if [[ -n "$PS1" ]]; then

同时因为if要和fi匹配,所以修改为:

if [[ -n "$PS1" ]]; then
  # Some code here... e.g.
  export HISTCONTROL=ignoreboth
fi

2.  在~/.bashrc最末行添加:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

ps: 在安装过程中,我不知道算是自己没有认真看文档,还是英语水平不够,记得第一次安装了很久,只是看到有代码的地方有copy过来在shell里运行,根本就不懂为什么,或者怎么做,这次安装和第一次相差大概有两个多月吧,完全忘记了rvm的名称,只知道有这么个东西,需要安装。过程中也消耗了一些时间,充分说明:

1. 好记性不如烂笔头,过程中google不能链接,完全是靠记忆了,baidu真的不行,想着万一哪天google真的完全退出中国了,我们这些整天依赖google的程序员怎么办。

2. 英语还是很重要的。

3. 要仔细阅读文档。

电脑不好用,键盘很烂,速度很慢!

猜你喜欢

转载自luoping0425.iteye.com/blog/854392