Monday, February 15, 2016

How to install Ruby on Rails on CentOS 6

This is a quick tutorial on how to install Ruby on Rails on CentOS 6. Before installing Ruby on Rail just want to briefly explain what Ruby on Rails is. Ruby on Rails is an application stack that provides web developers with a framework to quickly create a web application. All right well enough jabbering lets get on with the installation.

Installing Ruby 2.18 using rvm.
NOTE: by default ruby 1.8.7 is installed on centos 6.

Step 1. Install the required 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 sqlite-devel
Step 2. Install the latest version of RVM
# curl -L get.rvm.io | bash -s stable
# cd tar -xzvf /usr/local/rvm/archives/rvm-1.26.11.tgz
# cd /usr/local/rvm/archives/rvm-1.26.11/binscripts
# ./rvm-installer
Step 3.  Setup the RVM Environment 
# source /etc/profile.d/rvm.sh
Step 4. Install ruby 
# rvm install 2.1.8

Step 5.  Configure the Default version of Ruby 
# rvm use 2.1.8 --default

Using /usr/local/rvm/gems/ruby-2.1.8

Step 6.  Check the current version of Ruby 

# ruby --version

ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux]

Install Rails 
#gem install rails -V
Create a Test Application (Optional) to verify that Rails is working properly
NOTE: After running the rails server --binding= the following error might pop up " There was an error while trying to load the gem 'uglifier'" if you see this error you will need to install nodejs. Run the following commands to install nodejs  

curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs
npm install -g express-generator
npm -g install npm@latest

cd ~

rails new testapp 
The move into the applications directory 
# cd testapp
Create the sqlite3 database:
rake db:create 
http://server ip address:3000

No comments:

Post a Comment

Cracking Kerberos Service Tickets (TGS) Using Kerberoasting

As of late I've been spending a lot of time researching and learning different techniques when it comes to attacking Active Directory En...