Rails 4.0 Beta Quick Start

In the wake of this talk being posted today, I took a bunch of notes and was a bit excited about a few of the changes (turbolinks is awesome!) so I decided to set up a test app. Here’s how to get rolling with Rails 4.0 beta (known as edge Rails, we’re living on the edge!). I write Rails code on Ubuntu and despite 12.10 being released today, I’m on 12.04 64-bit. This guide should work the same on Linux and Mac, and may work on Windows.

Clone Edge Rails

git clone git://github.com/rails/rails.git

Setup a new RVM gemset

I’m still a huge fan of RVM and gemsets. Let’s make a new one:

rvm use 1.9.3-p286@four-oh-beta-project --create

Rails 4 will require Ruby 1.9.3 and a new version of it was released just this week. I also recommend the falcon patches, which apply cleanly to the new 1.9.3 release. With numerous security fixes, you should upgrade to p286 now. We’ll install a few gems in our new gemset to make sure everything goes goes smoothly when starting our edge example project.

gem install i18n thor

Generate your project

cd rails
railties/bin/rails new ~/projects/four-oh-beta-project --edge

Bundle and go

Change into your project directory, bundle and you’re ready to ride 4.0 beta. If you want to get started with ActionController::Live, make sure add to your Gemfile a web server that supports it (I suggest thin, other choices are puma and rainbows, but not webrick or unicorn).

Give it a try today and let me know how it works for you.