Rails 3
The third generation of Ruby on Rails brings some major improvements and fixes over previous versions. Some of the highlights include a new Active Record query engine, a new router for Action Controller, a completely rewritten Action Mailer, dependency management with Bundler, XSS protection by default, better handling of character encoding, improvements to Active Model, an official plugins API and many other minor improvements. For more information see the Rails 3 release notes.
Getting Started
Running your Rails 3 applications on Brightbox is as easy as you've come to expect, we've added full Rails 3 support to our Rails stack and deployment tools to make things as simple as possible. Here we cover how to get started with Rails 3.
The official Ruby on Rails documentation and Rails guides have been updated to reflect the changes in Rails 3 and make a great starting point.
Prerequisites
- Ruby >= 1.8.7 or 1.9.2
- Rubygems >= 1.3.7
- Brightbox deployment gem >= 2.3.7
- librack-ruby >= 1.1.0 (Passenger only)
Ruby
Lucid based Brightboxes include 1.8.7 by default. Ruby 1.9.2 is also supported, though we don't have packages for it just yet. If you're using Hardy based Brightboxes you'll need to upgrade the standard Ruby Enterprise Edition package like so.
Edit your /etc/apt/sources.list.d/brightbox-rubyee.list file and change the rubyee component to rubyee-testing:
deb http://apt.brightbox.net/ hardy rubyee-testing
Then upgrade:
sudo apt-get update sudo apt-get install libruby1.8
Rubygems
New Brightboxes include our 1.3.7 rubygems package for Ubuntu by default, but if you're running an older version you can upgrade like so.
sudo apt-get update sudo apt-get install rubygems
If you have installed Rubygems from source, our Ubuntu package will automatically replace the source installed version while preserving all your currently installed gems. We recommend using our packaged version.
Brightbox deployment gem
For full Rails 3 support, Brightbox gem version 2.3.7 or later is required, if you're using an older version you'll need to update like so.
sudo gem install brightbox
Don't forget to update the brightbox-server-tools gem on your Brightboxes too!
sudo gem install brightbox-server-tools
librack-ruby
If you're using Passenger you'll need librack-ruby >= 1.1.0. Newly built Hardy and Lucid Brightboxes include 1.1.0 by default but if you're using a box built a while ago you can upgrade like so.
sudo apt-get update sudo apt-get install librack-ruby1.8
Installation
If you're using Bundler to handle dependencies (recommended) for your Rails 3 app you don't need to do anything, the Rails 3 gem will be installed automatically the first time you deploy your application on a Brightbox. If for some reason you're not using Bundler you'll either need to add a manual gem dependency to your deployment recipe or install by hand like so.
sudo gem install rails -v3.0.0