Ruby on Rails

Rails is a hugely popular web development framework, implemented in Ruby.

The first version of Rails was released back in 2004. Embodying the idea of "convention over configuration" it grew rapidly, attracting followers who had become weary of repeating the mundane tasks required by other frameworks. Combined with the highly dynamic nature of the Ruby programming language, the Rails conventions made for a very productive development environment.

Rails Resources

There is a plethora of useful documentation, tutorials and blogs for you to read, but these sites stand out as being worthy of note:

Once you've got started, these are very useful:

  • railsapi.com -- JavaScript enhanced copies of the Rails API (can be viewed online but best downloaded to your computer).
  • Railscasts -- regular screencasts from Ryan Bates demonstrating how to achieve specific tasks in Rails.
  • Rails Recipes -- a book by Chad Fowler that contains plenty of worked examples, covering many common tasks encountered by the practicing Rails developer. Updated for Rails 3.1.
  • News from the edge of Rails -- Rails moves fast, and Ryan Daigle's blog is a great way to keep up with the latest developments.

Oh, and if you're not yet familiar with Ruby get acquainted before you start learning Rails (I've listed some useful resources on my Ruby page). If you don't understand Ruby syntax you'll have trouble separating the language from the framework, and that really slows you down.

Articles on Ruby on Rails

  1. Automating bundle exec

    Bundler is a great way to control the versions of the gems that are used in your Ruby application, but it requires you to run Ruby scripts and tools (such as rake and heroku) by prefixing them with an extra command (e.g. bundle exec rake). This is a pain, can be easy to forget, and can cause no end of subtle bugs if the script that you're running can be found outside of the bundled application, in your shell's PATH.

    Continue reading

  2. Searching Haml and SASS with ack

    If, like me, you've recently discovered the wonderful speed of the ack search tool, you may be frustrated to find that it ignores some of your source code. Files that you know should be appearing in your search results just don't show up, as ack doesn't consider .haml or .scss files to be worth searching. Well, we can fix that.

    Configure your ack...

  3. database.yml should be checked in

    It's generally acknowledged to be good practice to keep your production database.yml file away from your version control system. Why? So that people snooping around your version control system don't find your database password. There are plenty of examples out there that tell you how to set your production password with Capistrano, but I'm talking about the database.yml file used during development.

    Continue reading

  4. Easy git-svn for Rails (or "git-me-up")

    I've been trying to persuade git-svn to work properly with Rails plugins that are installed via svn:externals. Whilst working out how to do it I stumbled across several great articles, but I couldn't get any of the solutions presented to work perfectly.

    After a bit of head scratching I got it sorted, and wrapped the process up in a little utility called git-me-up.

    Continue reading

  5. Monitoring BackgrounDRb with God

    God is a very neat piece of software, frequently used by Rails developers to monitor mongrel servers, and restart them if/when they crash or use up too many system resources.

    Its use isn't limited purely to monitoring web servers though; you can monitor pretty much anything you like. Read on to see how to configure it to monitor the Ruby job processing daemon, BackgrounDRb.

    Continue reading