Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Ruby 1.9.3 on CentOS, RedHat using RVM
Step 1: Upgrade Packages
# yum update
# yum groupinstall "Development Tools"
Step 2: Installing Recommended Packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel
# yum install libyaml-devel libffi-devel openssl-devel make
# yum install bzip2 autoconf automake libtool bison iconv-devel
Step 3: Install RVM ( Ruby Version Manager )
curl -L get.rvm.io | bash -s stable
Step 4: Setup RVM Environment
source /etc/profile.d/rvm.sh
Step 5: Install Required Ruby Version
# rvm install 1.9.3
Step 6: Install Another Version ( if Required )
# rvm install 1.8.6
Step 7: Setup Default Ruby Version
rvm use 1.9.3 --default
Step 8: Check Current Ruby Version
# ruby --version
Update rubygems
$ gem update --system
$ gem install bundler
#Test ruby and rubygems are working
#Close shell and reopen for changes to take effect
$ruby -v
$gem --version
# Rails
$ yum install sqlite-devel
$ gem install rails
$ gem install sqlite3
@dave-jay

This comment has been minimized.

Copy link

@dave-jay dave-jay commented Nov 11, 2015

Thanks! - so much helpful

@Haezal

This comment has been minimized.

Copy link

@Haezal Haezal commented Jan 29, 2016

Very helpful tutorials. Just follow step by step. Now my ruby version is 1.9.3.

@mykhailo-petrenko

This comment has been minimized.

Copy link

@mykhailo-petrenko mykhailo-petrenko commented Mar 17, 2016

Thanks!

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Mar 22, 2016

thanks!

for me, step 4 was "source ~/.profile"

@XDestination

This comment has been minimized.

Copy link

@XDestination XDestination commented May 23, 2016

thank you :)

@daemonchen

This comment has been minimized.

Copy link

@daemonchen daemonchen commented May 24, 2016

when I run gem install rails, then I got the error

ERROR:  Error installing rails:
    mime-types-data requires Ruby version >= 2.0.

my ruby version is ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]

@manusreload

This comment has been minimized.

Copy link

@manusreload manusreload commented May 30, 2016

Same issue a @daemonchen

[root@localhost ~]# ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
[root@localhost ~]# gem --version
2.6.4
[root@localhost ~]# gem install tins
ERROR:  Error installing tins:
    tins requires Ruby version >= 2.0.
@oleksandrzelentsov

This comment has been minimized.

Copy link

@oleksandrzelentsov oleksandrzelentsov commented Jun 24, 2016

@manusreload, you need to
rvm <version here> --default OR rvm use <version here> --default
not sure what works
but worked for me

@rajeshapt

This comment has been minimized.

Copy link

@rajeshapt rajeshapt commented Jul 12, 2016

Awesome..so crystal clear steps and works like a gem..tons of thanks..

@dhdanno

This comment has been minimized.

Copy link

@dhdanno dhdanno commented Jul 14, 2016

👍

@dykim78

This comment has been minimized.

Copy link

@dykim78 dykim78 commented Aug 3, 2016

This is great!

@naptastic

This comment has been minimized.

Copy link

@naptastic naptastic commented Nov 7, 2016

This is clever, but there's a much better way that works much better with CentOS: Software collections. Consider this as an alternative to what's basically an OS-uncontrolled source compile on your system: https://www.softwarecollections.org/en/scls/?search=ruby

@charliebritton

This comment has been minimized.

Copy link

@charliebritton charliebritton commented Nov 30, 2016

Lovely tutorial for this. Has been mentioned before, but I needed to change source /etc/profile.d/rvm.sh to source ~/.profile apart from that though, very good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment