Gettextの罠
RailsでRuby-Gettext-Packageを使っているのだが、罠にはまる。
Railsのapplication_controllerでinit_gettextメソッドを呼ぶことでバリデーションメッセージを日本語にしているのだけど、
その処理の中でこんなエラーが出た
NoMemoryError (failed to allocate memory): /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/mo.rb:91:in `read' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/mo.rb:91:in `load_from_stream' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/mo.rb:255:in `load_from_file' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/mo.rb:255:in `open' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/mo.rb:255:in `load_from_file' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/mo.rb:68:in `load' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/mo.rb:38:in `open' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomain.rb:189:in `load_mo' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomain.rb:184:in `each' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomain.rb:184:in `load_mo' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomain.rb:183:in `each' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomain.rb:183:in `load_mo' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomain.rb:110:in `set_locale' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext.rb:299:in `set_locale_all' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomainmanager.rb:41:in `each_all' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomainmanager.rb:40:in `each' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/textdomainmanager.rb:40:in `each_all' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext.rb:298:in `set_locale_all' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/rails.rb:89:in `init_gettext_main' /usr/local/lib/ruby/gems/1.8/gems/gettext-1.8.0/lib/gettext/rails.rb:117:in `init_gettext'
まじですかい・・・・orz