Fixing GetText Gem

Update:Fast Gettext gem has resolved all major problems of GetText 😉

Update: gettext 1.92.0 has fixed this issue, update if you can…

Just got a surprising:
NoMethodError (undefined method `file_exists?’ for File:Class):
gettext/rails.rb:281

281c281
<       return render_file_without_locale(localized_path, use_full_path, local_assigns) if file_exists?(localized_path)
---
>       return render_file_without_locale(localized_path, use_full_path, local_assigns) if (respond_to?(:finder) ? finder.file_exists?(localized_path) : file_exists?(localized_path))

put it in a gettext.patch and then:

sudo patch /usr/lib/ruby/gems/1.8/gems/gettext-1.91.0/lib/gettext/rails.rb < gettext.patch

Cause of failure: file_exists?(=cached checking if a file exists) was moved to finder in Rails 2.1
Alternatively one could monkeypatch rails to make it work for Rails 2.1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s