Rails

Jeff's Guide to Installing Rails

How to install everything you need to create Rails applications on your laptop.

Mac OS X Overview In Plain English

If you're new to programming, you might be surprised to learn that Rails isn't something you can just download and start using right away. Like many open-source technologies, the Ruby on Rails framework is built on top other open-source components that must be installed first.

There is no single installation procedure that will work for everyone. Your ability to install all of the components leading up to, and including, the Rails framework depends on many factors: your operating system version, other software you may have previously installed, and any customizations you may have already done to your environment.

There are seven - that's right, seven - components we need install.

  1. XCode. This is the Apple software environment. Although you won't need the IDE editor (it's used primarily for Objective-C programming), installing XCode ensures that many of the base components that Rails depends upon will be present on your computer.
  2. Apple Command-Line Tools. This is an add-on to XCode that is not installed by default. These tools provide another layer of code libraries that are necessary for Rails.
  3. Git. Git is a program that enables you to share your code with others, and get code that has been shared with you. You'll probably use it to send and receive code from the popular code sharing site Github .
  4. RVM. RVM stands for Ruby Version Manager, and it will automate the process of installing the Ruby programming language on your machine. Although you will probably only ever use one version of Ruby, it's namesake comes from the fact that it can install as many different versions of Ruby as you like and switch among them easily.
  5. Ruby This is the programming language we will use to create Rails applications. Hang on, we're almost home!
  6. Rails Finally, we install the Rails framework itself.

Now you're ready to follow the installation instructions!

After Rails is installed, you'll need a code editor. I recommend Sublime Text 2 .

Mac OS X Installation Instructions For Ruby 2.0 and Rails 3.2.13

If you haven't already read the overview in plain English , please do so before you proceed.

The following steps should help you get Ruby 2.0 and the latest version of Rails up and running.

Step 1 Install Ruby and Rails

We can install the RVM tool, the latest version of Ruby, and the latest version of Rails, all in one command.

Open your Terminal, and paste the following entire line:

\curl -sSL https://get.rvm.io | bash -s stable --rails
Don't Forget That Slash. Yes, you really do need to start with that backslash.

It will take a while for everything to install. When it's done, quit the Terminal completely and start it up again.

After you've restarted Terminal, enter this:

ruby -v

If you get a response of "Ruby 2.0.0" then you're ready for Step 2!

Step 2 Update RubyGems

Enter this command into your Terminal:

gem update --system

That should bring your version of RubyGems up to at least 2.1.10:

gem -v
2.2.3

Step 3 Check that Rails is Installed

While still in Terminal,

rails -v

If you see "Rails 4.0.2", congratulations, you're all set!

Next, you'll need a code editor. I recommend Sublime Text 2.

Windows Overview In Plain English

If you're new to programming, you might be surprised to learn that Rails isn't something you can just download and start using right away. Like many open-source technologies, the Ruby on Rails framework is built on top other open-source components that must be installed first.

There is no single installation procedure that will work for everyone. Your ability to install all of the components leading up to, and including, the Rails framework depends on many factors: your operating system version, other software you may have previously installed, and any customizations you may have already done to your environment.

There are five - that's right, five - components we need install.

  1. SQLite. SQLite is a database engine. Rails lets us create database-backed web applications, which means we're going to need to store most of our application's data in a database. SQLite is a great way to get started. Unlike a Mac, Windows does not ship with a database engine right out of the box, so we'll need to install SQLite.
  2. Git. Git is a program that enables you to share your code with others, and get code that has been shared with you. You'll probably use it to send and receive code from the popular code sharing site Github .
  3. Ruby. This is the programming language we will use to create Rails applications. You should use version 1.9.3 or 2.0.0.
  4. DevKit. DevKit is a tool that allows Windows developers to consume many of the most common open-source "Ruby gems" that you'll want to include in your Rails apps.
  5. Rails. Finally, we install the Rails framework itself.

Now you're ready to follow the installation instructions!

Windows Installation Instructions For Ruby 1.9.3 or higher; and Rails 3.2.13

If you haven't already read the overview in plain English , please do so before you proceed.

The following steps should help you get Ruby and the latest version of Rails up and running.

Step 1 Follow the RailsBridge Guide Steps 1 - 8

The RailsBridge folks have put together a nice guide to getting up and running on Windows. You don't have to go through the entire guide, but be sure to complete at least steps 1 through 8.

The RailsBridge Guide to Installing Rails on Windows

Step 2 Install Sublime Text

Use my Setting Up Sublime Guide to download, install, and configure Sublime Text. The instructions on my guide are for Mac but the Sublime Text website also has installers for Windows, and my configuration instructions are nearly the same.

You should feel free to use any other Windows-friendly editor of your choice. It just has to be a program which loads and saves plain text files (i.e. do not use Miscrosoft Word).