How to setup Rails Environment

What is Rails? Rails is a "full stack" web server and development platform for dynamically created database backed website. Say like you have videos and display it in your website or blog or any else.

Rails is simply a Ruby GEM that implements a full web server and dynamic database driven website generator. Because of Ruby is written in Ruby language, you can run it in multi platform OS (Mac, Linux, Windows).

Rails is a "full stack" meaning it deals with everything from request from a browser, processing, getting value of database and rendering back the output to browser.

If you are new, i suggest you to read Michael Hartl book: "Ruby on Rails Tutorial (3rd Edition). It has all of the material for beginner to start with. I also started to learn Rails seriously (i mean, i just know ruby on rails and just that) this year into deeper knowledge. That book really help me to start with Rails Development.

Okay, so now how can we setup Rails Environment? Like i said above, you can develop Rails on any OS because it is based on Ruby language that can run on any OS. This tutorial will use Mac because i only have that.

Setting Up Rails Environment

There are many methods to setup Rails environment. You can start with Package Management System base on your platform, Installer, or Managers, or even build from source code.

I suggest you to start with Ruby Managers. There are many Ruby managers out there. One of the best Ruby managers is RVM.

Use RVM, the Ruby Version Manager, to install Ruby and manage your Rails versions.

RVM will leave your “system Ruby” untouched and use your shell to intercept any calls to Ruby. There’s no need to remove it. The “system Ruby” will remain on your system and the RVM version will take precedence.

Step to install:

  1. Install RVM
    Before any other step, you need to install the public key:
    gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    Install RVM stable release:
    curl -sSL | bash -s stable
  2. Install Ruby
    rvm install 2.2.2
    This will install Ruby 2.2.2 (current stable release).
  3. Install Rails
    gem install rails

To check if Rails is successfully installed, type:
rails -v

This will show Rails version installed, mine show this:

Rails 4.2.3

Then congratulations. You have completed to setup Rails Environment and ready to build your first app.

wahyu way

Tech savvy, mobile app consultant, hard worker, runner, traveller