RubyHead Screencast Short – Subdomain in Rails

Ever wonder how Rails apps can recognize your account by subdomains? Well, here’s how.

RubyHead Short – Subdomain in Rails from Joon You on Vimeo.

Freezing Libxml-Ruby Gem In a Rails App

There are times when you want to freeze a gem to make the deployment easier. As for me, I wanted to make sure that my app is using 1.1.3 version of libxml gem. This is a bit of problem since it requires a compilation.

I made this easy. All I have to do is download this file, extract to vendor/gems directory, and make sure you “vendor everything”. In other words, put following lines in Rails::Initializer.run block in your environment.rb.

config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir|
File.directory?(lib = "#{dir}/lib") ? lib : dir
end

If you don’t know what this is all about, go here.

IT IS VERY IMPORTANT that the binaries are for Ubuntu 8.04LTS (although it should work on 8.10, but I can’t guarantee it) and Mac OS X Leopard.

With this, you don’t have to have libxml-ruby gem installed on your machine. The same technique goes for any other gems that require compilation.

« Previous Page

Powered by Olark