Home > English > Tutorials > How to install ruby ,ruby gem ,rails on centos

How to install ruby ,ruby gem ,rails on centos

 

Ruby is...

A dynamic programming language and open source, focusing on simplicity and high efficiency. It has a clear syntax, familiar and easy to write 

I.Preparation :

Homepage https://www.ruby-lang.org/ Click here

Download ruby versions in this page Click here

http://cache.ruby-lang.org/pub/ruby/

Install epel repository, reference link here Click here

II.Proceeding:

Install gem

Install some packages 

# yum groupinstall -y 'development tools'

# yum install -y gcc gcc-c++ make zlib-devel pcre-devel openssl-devel wget

Creat a folder storing downloaded files 

# mkdir /download/

Download Ruby gem installation file into the folder download and upzip it

# cd /download/

# wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz 

# tar -xvf ruby-2.3.0.tar.gz 

Then access the folder Ruby which has been upzipped 

# cd download/ruby-2.3.0

Run these commands to install 

# ./configure

# make

# make install

Test the version

# gem -v

Install rails

Update game 

# gem update

During updating there will be some questions, just press 'y' 

Install rails with this command

# gem install rails

Test the version

# rails -v