How to install Ruby on Rails on Ubuntu?


Nowadays every business is moving towards the cloud server environment and the reason behind it is that today using cloud server hosting gives you a lot more advantages than in any other hosting platform. And in those advantages on of the best advantages is that you get better security and you no need to worry about your data at the time of disaster.  And in the cloud server, all your data are stored, maintained, managed and backed up remotely. And in cloud hosting all the resources can be scaled vertically or horizontally to meet its demands. One of the best benefits that you get from using cloud server is that rapid deployment of computing resources, high performance, and service reliability.


So today by using cloud servers for a business you can reduce the size of your own data centers by this the number of staff can significantly reduce the IT cost. Cost-Effectiveness Cloud services are known to be very economical. So today if you are using a cloud hosting server for your website and if you are looking for information on how to install Ruby on Rails on Ubuntu 14.04 in Cloud server then here is the complete solution on it. Ruby on Rails is a framework which is written in the Ruby programming language where it allows you to use Ruby in combination with HTML, CSS, and similar programming languages.


Here are the steps to install Ruby on Rails on Ubuntu 14.04 in Cloud server:


>>> Installing dependencies


>> Installing dependencies, to install follow this command-


apt-get update


>> Now you have install these dependencies


sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev


>>> Installing Git


>> To install Ruby you need to install Git, so here is the command to install it


apt-get install git


>>  Now you have to Configure Git by using this command


git config --global "Alex Noman"

git config --global "This email address is being protected from spambots. You need JavaScript enabled to view it."


>>> To install rbenv


This is a tool which is used for deploying Ruby environments. to execute it use the below commands-


git clone git:// .rbenv

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile


git clone git:// ~/.rbenv/plugins/ruby-build

echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile

source ~/.bash_profile


>>> To install Ruby use the below command


rbenv install -v 2.2.1

rbenv global 2.2.1


>> Install the Bundler gem:


gem install bundler


>>> To install RoR, once installing a Ruby you need to install ROR. To install follow this command


gem install rails


>> Once the installation is done you need to check whether it is been installed properly or not  by this command


rails -v


>>> To install Node.js


>> To use some rails features you need a JavaScript runtime, so to install Node.js add the repository to apt-get by using this command


add-apt-repository ppa:chris-lea/node.js


>> Now update the apt-get first and then install Node.js by using below command


apt-get update

apt-get install nodejs


>>> Once you install Node.js you need to create a test application, at that time use this command-


rails new test


>>Go to the ~/test directory which you have created, then start your Rails application by using this command


rails server --binding=YourServerIP


>> Now to check your website follow this- http://YourServerIP:3000