Recently, I started web application developing by Ruby on Rails. I had to configure and set ruby and rails environment in my PC. You can install it system’s package management utilities. But I have prefer to install it using the Ruby Version Manager (RVM). It’s a actually a slick set of scripts that help you to install multiple versions of Ruby on your system. So, let’s start ..
First, you will have to install the some necessary tools and libraries. Open terminal and type the following line.
sudo apt-get install curl git-core build-essential zlib1g-dev libssl-dev libreadline5-dev
To install rvm, type . .
curl -L https://get.rvm.io | bash -s stable --ruby
Test that RVM works or not.
Now, you can begin ruby 2.2.0 installation.
rvm install 2.2.0
You can check available ruby version isntalled in your system
If you multiple version install in your system, you will get something likes ad below
rvm rubies =* ruby-2.1.2 [ x86_64 ] ruby-2.2.0 [ x86_64 ] # => - current # =* - current && default # * - default
Next, you will have to set any of them as the default version. In this case, i did the most latest one..
rvm use ruby-2.2.0 --default
Test your new ruby installation by typing following command.
So, Ruby installation is done. Let’s start Installing the latest version of Rails
gem install rails
Finally, install some bindings:
sudo apt-get install libmysql-ruby libmysqlclient-dev gem install mysql
Well. Everything is done so far. Now create new rails project.
rails new helloworld