RVM , Ruby , Rails and You

This tutorial is specially for RVM, Ruby , Rails and You . It’s really difficult to setup development environment for any system and it may consider as the most difficult phase of development. Many developers looses their patience while setup development environment.
Every time I set up RVM, Ruby and Rails , I found new error . So this time I wrote this tutorials for you so that you will not faces these difficulties.

Ruby Version Manager (RVM):

Ruby(R) Version(V) Manager(M) was originally started in October 2007.RVM started as a personal project, however it very quickly ballooned into a feature rich application. RVM basically used to controlled the different versions of ruby .
As we all know Projects are version dependent and in this world of development , things are changes very frequently. So it is hard to maintain our code , plus clients want their projects in latest version. For different projects we use  different versions at a time and RVM gives us this facility :D.

Ruby On Rails :

Ruby is an object oriented programming language even you must say genuine object oriented programming language , while rails is a framework similar to .net , spring etc that make it easier to develop , deploy and maintain web application .
I know here some peoples thinks like why rails ?? how it is different from other languages?? etc . But it need a separate article to discuss on ruby on rails  so better to leave it here for those articles .

Step by Step procedure to install RVM, Ruby and Rails

As I told you before this tutorial is specially for RVM , Ruby , Rails and you . So let’s start step by step installation of RVM. Follow the below steps to install RVM in your Linux system : either ubuntu or kali linux or any other. I am using kali linux for this tutorial.

  • Open your terminal
  • Enter commands listing below:
    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    \curl -sSL https://get.rvm.io | bash -s stable --ruby
  • If both commands works fine , enjoy your ruby coding withRVM else if it shows some error like
    Error running 'requirements_debian_libs_install gawk libyaml-dev libsqlite3-dev autoconf libgdbm-dev libncurses5-dev automake libtool', showing last 15 lines of /home//.rvm/log/1433925827_ruby-2.2.1/package_install_gawk_libyaml-dev_libsqlite3-dev_autoconf_libgdbm-dev_libncurses5-dev_automake_libtool.log

    then follow the commands given below :

  • Copy and paste command given below in your terminal and hit enter
    sudo apt-get install build-essential openssl libreadline6 libreadline6-dev \
    curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 \
    libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison  \
    subversion pkg-config
  • Above command install essential packages for your system like libssl-dev etc.
  • Now enter command
    sudo apt-get install gawk libgdbm-dev libncurses5-dev
  • Now again enter :
    \curl -sSL https://get.rvm.io | bash -s stable --ruby
  • If above command works fine then enter the command given below to installRVM else tell us about your error in comments
    source /Users/{your_user_name}/.rvm/scripts/rvm
  • Allis done 😀 Now to install ruby version 2.2.2 enter command
    rvm install 2.2.2 --autolibs=enable
  • Then run
    rvm use 2.2.2
  • To make this the default version of Ruby for future sessions, run:
    rvm --default 2.2.2
  • All is done for RVM and Ruby

See Also: Top 5 Android Apps a Programmer must have

 

Installation steps for Rails on Kali Linux

I used Kali linux for rails development , you can use any other linux based operating system such as ubuntu, mint OS etc . But window is not recommended for rails development as it have too many issues with rails.
To install rails on your Linux follow the steps given below :

  • Enter the command
    sudo apt-get install ruby-dev
  • Then type
    gem install rails --pre
    gem install sqlite3-ruby
    sudo apt-get install libsqlite3-dev   #if it is not already installed , we installed it already in above steps with RVM

Enjoy your developing with RVM, Ruby, Rails 😉

Ruby Installation on Windows

Ruby installation on Windows is bit easy than linux, you just need to Download and run Ruby Installer which is a exe (Window executable file).

Download Ruby 2.2.2 Installer for windows Ruby 2.2.2
To use Ruby from cmd(command prompt) , you need to set its path variable. Follow below steps to set path variables.

  1. Open your control panel.
  2. Go to system
  3. Now click on Advance System Setting on Left side bar.
  4. Click on Environment Variables
  5. Now find path and double click on.
  6. Copy and Paste C:\Ruby22-x64\bin in variable value.

Enjoy Your Ruby on windows.

Rails Installation on Windows

Rails installation is similar to ruby installation , you can download railsinstaller from here.

Rails Installer for windows RailsInstaller

But I don’t suggest to working with rails on windows as their are too many issues with windows.

Have something to add or still stuck somewhere ?? share it in comments .

Follow us on Facebook, Google Plus and Twitter.

2 COMMENTS

Comments are closed.