Monday, December 20, 2010

Bundler for ruby applications

I just found out that Rails3 is using Bundler to manage all of the gem dependencies.

This is just an awesome idea ;-)

I use to write custom deployment script for all of the new instances that I create in the cloud.

With this, you can easily manage the dependencies for your ruby application anywhere you choose to run.

Include ruby json gem into Rails3 automatically

First, install the gem from command line.
> sudo gem install json
Then, add the following line to Gemfile
gem 'json'

How to autoload libraries from lib directory for Rails3

Inside application.rb
module ApiServer
  class Application < Rails::Application
    # Custom directories with classes and modules you want to be autoloadable.
    # config.autoload_paths += %W(#{config.root}/extras)
    config.autoload_paths += %W(#{config.root}/lib) 
  end
end