ActiveRecord Gem Gotchya

Published: 05 Dec 2007

There is a gotchya related to how you require ActiveRecord. Apparently, in older versions of Ruby (eg. the version packaged with Leopard) something like the following will NOT work:

require 'activerecord'

with something like the following error:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- activerecord (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from main.rb:5

However if you use this form:

require 'active_record'

it WILL magically work.

Look here for a related patch.