CentOS install Ruby On Rails

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

参考ubuntu 12.04安装ruby1.9.3

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

 Posted by  at 04:06  Tagged with: 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值