Forum: Ruby on Rails Migrations on models using gettext validation messages

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Mark B. (Guest)
on 2006-04-03 10:13
(Received via mailing list)

The time has come for me to explore migrations, and the first thing I've
is that it seems to be unaware of calls to the gettext function _() for
translating validation messages:

** Invoke migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute migrate
rake aborted!
undefined method `_' for Account:Class

  validates_length_of :name, :within => 4..40, :message => _("name was

Any ideas?


Mark B.
Easy School Management
Mark (Guest)
on 2006-04-13 11:10

Thanks to the guys on #rubyonrails - turns out I just had to require
gettext in environment.rb instead of application.rb.

This topic is locked and can not be replied to.