Install RVM, Ruby on CentOS

First download the Ruby Version Manager (RVM) installer as follows

$ sudo bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

RVM requires to add relevant users to it’s group. Open the file like so:

$ sudo vim /etc/group

Edit the ‘rvm’ group (likely the last entry) to look like:

rvm:x:503:your_username
Run the install:

$ cd /usr/local/rvm/bin
$ sudo ./rvm-installer
...

“Upgrade of RVM in /usr/local/rvm/ is complete.”

I needed to reload the RVM to continue, this might not be required:

$ rvm reload

If it shows -bash: rvm: command not found

please close the terminal and start it again to load the RVM.

Now we can install the Ruby version. This will also install rubygems which is always useful…

$ rvm install 1.9.3 --with-openssl-dir=/usr
$ ruby -v
$ rvm use ruby-1.9.3-p327 --default

If you are getting nokogiri error like:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

checking for libxslt/xslt.h… no

libxslt is missing.

then install

$ sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel

Reference:
http://jamesmcfadden.co.uk/installing-ruby-on-rails-on-centos-5-8/

Author: Abhilash

Hey! My name is Abhilash - A Ruby developer for years, specialised on web programming, working as a freelancer. Mainly working on Ruby On Rails platform since 2010. This blog is about Ruby, Ruby On Rails and other subjects that I work. You can contact me here: abhilash.amballur@gmail.com

2 thoughts on “Install RVM, Ruby on CentOS”

  1. Just what exactly truly encouraged you to post Cordless Blinds “Install RVM,
    Ruby on CentOS | Web::Framework.find_by_name “Ruby On Rails””?
    I personallygenuinely liked the blog post! Thanks a
    lot ,Claude

    1. I always installed RVM, Ruby, all on Ubuntu OS. But suddenly from my new office they need these configuration on CentOS. I searched that, found it and thought that it will be good to post here for me in future and others like me, who needs these configuration on CentOS. And very nice to hear that from you..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s