Posts Tagged With: install ruby rails easily

Install Ruby on Rails easily on CentOS 6.4 with rbenv

Open Terminal

Install git:

sudo yum install git

Install ruby environment with RBENV:

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv

echo ‘export PATH=”$HOME/.rbenv/bin:$PATH”‘ >> ~/.bashrc

echo ‘eval “$(rbenv init -)”‘ >> ~/.bashrc

to check: restart terminal then type: type rbenv

If it say #=> “rbenv is a function” bla bla bla, it is successfull rbenv install

Install Ruby (2.1.2 version):

Install plugin ruby-build on rbenv:

https://github.com/sstephenson/ruby-build#readme

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

echo ‘export PATH=”$HOME/.rbenv/plugins/ruby-build/bin:$PATH”‘ >> ~/.bashrc

restart terminal

Install ruby 2.1.2 version:

rbenv install 2.1.2

then make it global ruby version on your local environment:

rbenv global 2.1.2

rehash the rbenv:

rbenv rehash

to check type: ruby

Install bundler:

gem install bundler

rehash the rbenv:

rbenv rehash

Install Rails:

First, you must install nodejs:

sudo yum install npm

check if it successfull: node –version

install rails:

gem install rails

long wait…

rehash the rbenv:

rbenv rehash

to check type: rails

Advertisements
Categories: IT | Tags: , , , , , | Leave a comment

Blog at WordPress.com.