在Linode服务器上安装Ruby

时间:2012-05-03 05:57:43

标签: ruby linode

此linode guide提供有关如何在服务器上安装ruby的说明。该指南使用与其他依赖项一起安装的ruby 1.8。如何更改这些命令以设置ruby 1.9.2?依赖关系似乎彼此相关联。

Linode指南的命令:

安装Ruby依赖项

apt-get install wget build-essential ruby1.8 ruby1.8-dev irb1.8 rdoc1.8 zlib1g-dev libopenssl-ruby1.8 rubygems1.8 libopenssl-ruby libzlib-ruby libssl-dev libpcre3-dev libcurl4-openssl-dev

创建符号链接

ln -s /usr/bin/ruby1.8 /usr/bin/ruby

ln -s /usr/bin/irb1.8 /usr/bin/irb

3 个答案:

答案 0 :(得分:2)

RVM是一个非常流行的安装Ruby的工具。

答案 1 :(得分:0)

如果你想安装ruby 1.9.2或1.9.3我建议使用rbenv(http://github.com/sstephenson/rbenv)

要在ubuntu机器上安装,以下内容应该有效:

curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
vim ~/.bashrc # add rbenv to the top
. ~/.bashrc
rbenv bootstrap-ubuntu-10-04
rbenv install 1.9.(your preffered version here)
rbenv global 1.9.(your preffered version here)

答案 2 :(得分:-1)

我在大约一周前做过这个,这是我的播放日志

# download rvm script
curl -L get.rvm.io > install-rvm
chmod +x install-rvm
sudo ./install-rvm

# add our user into rvm group
usermod -a -G rvm `whoami`
# log out & in
logout

# IMPORTANT: install dependencies given from command below
rvm requirements 
apt-get $deps-from-rvm
rvm install 1.9.3 #possibly do this with rvmsudo to install it globally

我知道它不会直接帮助你当前的情况,但在红宝石世界中真的推荐使用RVM。我会退出你的apt-get方法并使用RVM。无论如何,apt-get软件包肯定已经过时了。