Installing Ruby and Railswith RVM on Fedora 14

本文介绍了如何在 Fedora 14 系统上使用 RVM 工具安装 Ruby 1.9.2 和 Rails。首先安装了 RVM 所需的依赖包,接着通过 RVM 的指令完成了 RVM 的安装,并设置了默认使用的 Ruby 版本为 1.9.2。最后安装了 Rails 和一些常用的依赖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Installing Ruby has always been rather controversial. There are very few operating systems today that have a clean install and does not ass kick the system’s package manager. Ever since the introduction of RVM Ruby installs on Linux systems got so much easier. Today I reconfigured my workstation at home with Fedora 14, AwesomeWM and Dropbox (for config sharing across all workstations — sweet). RVM is a nice tool, but it shouldn’t be nescecary. Its nothing more than a crude hack to run multiple untested, possibly unstable Ruby versions. It saved lives during the switch to 1.9 and 1.9.2, but its not a long term solution for stable linux systems. But right now we need Ruby 1.9.2, so we will use RVM to fix that up.

On my mobile workstation I run archlinux, because battery matters, on which installing Ruby and Rails is rather painless.

$ pacman -S ruby
$ gem install rails

Done, easy, cheap shot and works like a charm and no need for RVM. Now, on to Fedora!

First we’ll install all packages RVM depends on:

$ yum install git ruby curl bison patch make

And install RVM for the current user only using RVM’s directive:

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

Done! Make sure you add the [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" line to the end of your .bashrc. The skeleton /etc/bashrc does not contain any return statements, so no need to fix that. Then do a source ~/.bashrc to make sure your path is updated.

Lets install some dependencies:

# As stated by RVM
$ yum install gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel iconv-devel

# And the rest most Rails apps will eventuall need
$ yum install libxslt-devel sqlite-devel openssh openssl-devel

Easy enough, lets get, compile, install and use Ruby:

$ rvm install 1.9.2
$ rvm use 1.9.2 --default

Lets install rails!

$ gem install rails

Nice! Now you can install other gems, use rake or do ruby stuff as normal :-) Note that if you ever need to rebuild Ruby for it to have proper bindings add the --force parameter to RVM, else it will not be recompiled, even though it says so.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值