Solution for undefined method `alias_method_chain’ after upgrading to Rails 2.3.2

by Michiel on June 11, 2009

Tonight I was working on an old Rails app which I upgraded to Rails 2.3.2. All code went fine and on my local Mac installation all worked perfect. When I tried to deploy to the live environment I got the following strange error:

undefined method `alias_method_chain’ for I18n::Backend::Simple:Class

At first, I thought this had something to do with new i18n stuff in Rails 2.3.2 and after half an hour of Googling I finally got the answer. ActiveSupport and ActiveRecord in Rails now require ruby-iconv to be installed. This is probably available in most installations – because there where only 2 pages of unhelpfull answers on Google – but it wasn’t on my production environment.

I hope this blogpost will save you some Googling and it will fix the undefined method `alias_method_chain’ for I18n::Backend::Simple:Class error message. Also this error can happen with the following message: undefined method `silence_warnings’ for main:Object.

So the solution is: install ruby-iconv. If you’re running FreeBSD, that’s in /usr/ports/convertors/ruby-iconv (via: http://forums.freebsd.org/archive/index.php/t-763.html)

More of my posts on this topic:

  1. This must be one of the best error pages
  2. 4 Rails gems and plugins you should know about

{ 2 comments… read them below or add one }

1 Michiel Sikkes June 12, 2009 at 12:10 am

Testing Disqus -> Twitter from the blog.

Reply

2 acid July 21, 2010 at 3:48 am

Thanx! :)

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: