If You Are New to Rails

What is the RailsApps Project?

This is an article from the RailsApps project. The RailsApps project provides example applications that developers use as starter apps. Hundreds of developers use the apps, report problems as they arise, and propose solutions. Rails changes frequently; each application is known to work and serves as your personal “reference implementation.” Support for the project comes from subscribers. If this article is useful, please support us and join the RailsApps project.

What You Need to Know: Rails 4.2 is the current stable version. Upgrade older projects to Rails 4.2 now. Notable additions include Active Job for queueing tasks to run separately from the user request-response cycle.

Earlier Releases

Mac OS X

Upgrade to Mac OS X Yosemite (10.10) before installing Ruby. Mac OS X comes with a “system Ruby” pre-installed. Mac OS X Yosemite includes the Ruby version Ruby 2.0.0p481 which is not the newest version. For flexibility during development, don’t use the system Ruby. Instead, install Ruby using RVM, the Ruby Version Manager.

What You Need to Know: Upgrade to Mac OS X Yosemite and install Apple’s Xcode Command Line Tools. Then use RVM to install Ruby.

Ubuntu Linux

On Ubuntu, package managers are available to install Ruby. For Ubuntu Linux, it is best to install RVM, the Ruby Version Manager, to install Ruby and Rails. The package managers are often not up to date. Use RVM instead.

Since Rails 3.1, a JavaScript runtime has been needed for development on Ubuntu Linux (it is not needed for Mac OS X or Windows). For development on Ubuntu Linux it is best to install the Node.js server-side JavaScript environment.

What You Need to Know: Use RVM to install Ruby and Rails. And install a JavaScript runtime.

Hosted Development

Nitrous.io provides a “hosted development environment.” That means the service provides a computer you use from your web browser. Accounts are free for small projects.

The web interface includes a browser-based file manager and text editor, plus a Unix shell with Ruby and Rails pre-installed. Any computer can access the hosted development environment, though you’ll need a broadband connection.

What You Need to Know: Use Nitrous.io if you don’t want to install Ruby on your computer.

Windows

Developing with Rails on Windows can be painful. Some gems requiring native extensions may be difficult to install. For this reason, most developers use Mac OS X or Ubuntu to develop Rails applications.

Nitrous.io is ideal if you have a fast Internet connection. If not, download the Railsbridge Virtual Machine or rails-dev-box for a virtual Linux computer with Ruby 2.0 and Rails 4.0 using Vagrant. The last option, RailsInstaller, is not recommended because it does not provide an up-to-date version of Ruby or Rails. Also, RVM does not run on Windows.

What You Need to Know: Use Nitrous.io, the Railsbridge Virtual Machine, or switch to Mac OS X or Ubuntu Linux if you can.

Where to Get Help

Your best source for help with problems is Stack Overflow. Your issue may have been encountered and addressed by others.

Comments

Is this helpful? Your encouragement fuels the project. Please tweet or add a comment. Couldn't get something to work? For the example apps and tutorials, it's best to open an issue on GitHub so we can help you.