现在的位置: 首页 > 综合 > 正文

Installing Ruby and Railswith RVM on Fedora 14

2018年01月10日 ⁄ 综合 ⁄ 共 1884字 ⁄ 字号 评论关闭

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.

【上篇】
【下篇】

抱歉!评论已关闭.