Digital Sanctum

software development, technology and other square topics

ActiveRecord Gem Gotchya

without comments

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:

CODE:
  1. /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)
  2.     from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
  3.     from main.rb:5

However if you use this form:

require 'active_record'

it WILL magically work.

Look here for a related patch.

Written by Shane

December 5th, 2007 at 8:28 am

Posted in Ruby

Leave a Reply