Ruby Version Manager简称RVM,是一款非常好用的ruby版本管理以及安装工具。
关于rvm的安装,可以参考以下文章:
use rvm install and manage ruby version
Set up professional rails3 develpment on ubuntu (part two)
我将自己安装rvm过程中碰到的问题及解决办法简单列一下:
1.执行:curl -k https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer >./ins
会报错:Unknown SSL protocol error in connection to raw.github.com:443
解决办法:去掉 -k ,即curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer >./ins
2.执行cat ins|bash -s stable命令的时候,报错如下:
Upgrading the RVM installation in /usr/local/rvm/ cp: 无法获取"/usr/local/rvm/src/rvm/bin/rake" 的文件状态(stat): 没有那个文件或目录 cp: 无法获取"/usr/local/rvm/src/rvm/bin/bundle" 的文件状态(stat): 没有那个文件或目录 Upgrade of RVM in /usr/local/rvm/ is complete.
# Administrator,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
Upgrade Notes:
* No new notes to display.
解决办法:不用管他,直接 source /etc/profile.d/rvm.sh 就可以启用rvm,如果rvm成功安装的话,使用rvm -v就可以查看rvm的版本信息。
root@kali:/# rvm -v
rvm 1.25.23 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
3.使用rvm安装软件的时候,下载速度很慢,怎么办?
解决办法:修改ruby的安装源到国内的淘宝镜像服务器
root@kali:~# gem source --add 'http://ruby.taobao.org/' source http://ruby.taobao.org/ already present in the cache root@kali:~# gem source -l *** CURRENT SOURCES *** https://rubygems.org/ http://ruby.taobao.org/
4.系统中已经安装了ruby 2.0.0p353。但,rvm use 2.0.0p353的时候会出错:
root@kali:~# rvm use 2.0.0p353 ruby-2.0.0p353 is not installed. To install do: 'rvm install ruby-2.0.0p353'
解决办法:使用人rvm list,列出已安装的ruby版本
root@kali:~# rvm list rvm rubies =* ruby-2.0.0-p353 [ i686 ] # => - current # =* - current && default # * - default
然后,根据上面列出的ruby名称,rvm use ruby-2.0.0-p353就可以切换ruby版本了
5.执行rvm gemset rails4命令后,报错如下:
Unknown subcommand 'rails4'
解决办法:rvm gemset create rails4 (create不要忘记了)