1. Technology
Send to a Friend via Email
You can opt-out at any time. Please refer to our privacy policy for contact information.

Setting up a Rails Development Environment


Setting up a Rails Development Environment

To program most Ruby programs you need virtually only two things: you need a basic text editor and you need a Ruby interpreter (usually MRI). Developing Rails applications are a bit more involved though, and you'll need quite a few more tools. The following is a list of things you'll need, as well as the choices that I personally made. For every tool there's more than one way to go, which tools you choose is really up to personal taste.

You may be wondering why an IDE is not recommended. IDEs are large, mostly inflexible beasts. There is no one way to develop a Rails application, and IDEs are generally not considered necessary or, by many, recommended.

A Command Line

The first thing that you'll need is a command line environment. You'll need to be able to issue Ruby commands, run the rails command line utility, etc. This sounds like a no brainer, but many people are intimidated by the command line. It's not hard, you'll just have to get used to it.

Almost any command line environment will do, but it's really not recommended to use the default Windows command line. The Windows command line prompt is, quite simply, crippled and archaic. It lacks an easy copy and paste, the line editing is a bit broken, there's no real tab completion, etc. There are bash environments such as the one included with msysgit (another tool you'll probably want anyway) that are much easier to work with.

For Linux or OS X, terminal programs and shells are plentiful. On OS X there is one in Applications -> Utilities -> Terminal, and gnome-terminal, konsole, xterm or similar are available on all distributions. The default Bash shell is perfectly fine, you only need to use a different one if it is your preference.

Version Control

Building a web application is not something you do from start to end in one go. You build them incrementally, especially with Rails. Since this is less like building a ship in a bottle, where you get everything in place and erect it in one action, and more like building a skyscraper, where you incrementally build higher and higher, you'll need something to help you keep track of changes. Version control keeps track of your project at every stage, and perhaps more importantly allows you to perform experiments that may fail. If they do fail, just roll back to the last known good state.

There are also obvious advantages if you're working in a group. More than one developer can work on different aspects of the application and version control helps you keep everyone on the same page.

There's really only one version control system that can be called the "de facto" in the Rails community: Git. Since its inception, it's quickly taken over the version control world. You can run it on your development machine without any servers, and interact with servers such a Github for collaboration. Early in Rails history people used Subversion more often, and there are other alternatives such as Mercurial, but Git is the "standard" in the Rails community.

Read more about installing Git on Linux or Installing Git on Windows.

A Web Browser

This might be another no brainer, if you're going to be developing a web application, you're going to need a web browser. However, you're going to need a web browser with a good dom inspector. This is an incredibly useful tool when things go wrong.

The two big choices are Firefox with Firebug or Google Chrome. There are other choices, and this is really personal preference, but make sure it has a dom inspector at the very least, and the more development tools the better.

An Editor

The minimum requirements for a Rails editor will be syntax highlighting, auto indentation and the ability to quickly switch between files in a directory tree. There are more editors than can be mentioned, so more than any other tool this is really up to you.

A popular choice is the TextMate editor for OS X. You'll see this text editor more than any other on Rails developer's machines and in screencasts. However, it's expensive and there's no shortage of alternatives.

The "big two" can be used easily, both Emacs and Vim are free, available on all platforms and more than capable. With the aid of a few scripts, if you're familiar with one of these already then you can easily use them.

A more free alternative to TextMate is the Sublime text editor. You can use it for free (though it's "nagware," occasionally prodding you with dialog boxes asking you to buy the editor), similar to TextMate in some respects and is cross platform.

Pen and Paper

Yet again, you might wonder why this is even mentioned. But doing things like sketching out pages, ad hoc flowcharts, etc help immensely. Rails is not about super careful planning, but one of the recurring themes for Rails is simple and effective communication of ideas. Really, there's nothing better than pen and paper for this.

  1. About.com
  2. Technology
  3. Ruby
  4. Ruby on Rails
  5. Ruby on Rails 3 Tutorials
  6. Setting up a Rails Development Environment

©2014 About.com. All rights reserved.