Posted by Chris Blackburn Thu, 03 Jul 2008 21:15:00 GMT

Recently, while trying to install the ultrasphinx gem for one of our projects, I ran into this little bonus:

(in /Users/cblackburn/Source/ruby/bols)
These gems that this application depends on are missing:
 - ultrasphinx
Run "rake gems:install" to install them.
rake aborted!
undefined method `validates_email_address' for #<Class:0x1f577f0>
/Users/cblackburn/Source/ruby/bols/rakefile:11
(See full trace by running task with --trace)

As usual I won’t bore you with why it happens other than to say the loader doesn’t work properly in this instance. To hack around it find out which models are using the ‘undefined method’ and place the following inside the class definition, before using the method.

# Hack to fix "undefined method" error when running rake on a gem not yet installed
require File.join(RAILS_ROOT, 'config', 'initializers', 'custom_validations')

Comment if you need more help or if this is not clear.

Posted by Chris Blackburn Wed, 25 Jun 2008 17:41:00 GMT

I’ll be publishing the status_update plugin for Rails in the coming weeks. The plugin is an interface to Ping.fm, the cool new service that allows you to update all of your social network statuses with a single API.

Coming Soon…

Older posts: 1 2 3 ... 18