CentOS版本:CentOS release 5.8
1. 更新系统,确保curl是新的。防止curl SSL错误。
yum update
2. 下载、安装git (可以不安装git)
可以到googlecode上下载最新的代码:http://code.google.com/p/git-core/downloads/list
wget http://git-core.googlecode.com/files/git-1.7.10.2.tar.gz
tar xzvf git-1.7.10.2.tar.gz
cd git-1.7.10.2
./configure
make
make install
git –version
(git version 1.7.10.2)
3. 安装RVM
curl -L get.rvm.io | bash -s stable
执行source ~/.rvm/scripts/rvm时可能会提示失败,因为安装的路径放到了/usr/local/rvm/scripts中,所以执行:
export PATH=$PATH:/usr/local/rvm/scripts:/usr/local/rvm/bin
source .bashrc
echo $PATH
确认上述路径已经加到PATH中。
查看rvm版本
rvm -v
rvm 1.13.8 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [ht
tps://rvm.io/]
type rvm | head -1
rvm is a function
4、安装ruby
rvm install 1.9.3-p194
这个过程中可能会提示yaml安装失败。
Installing yaml to /usr/local/rvm/usr
Error running ‘make install’, please read /usr/local/rvm/log/ruby-1.9.3-p194/yaml/make.install.log
Database file /usr/local/rvm/config/packages does not exist.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p194, this may take a while dependi
ng on your cpu(s)…
但是ruby可以安装成功。
下面解决yaml的问题。
5、rvm pkg install libyaml
6. rvm reinstall 1.9.3-p194
7. gem install rails
rails –version
Rails 3.2.3