Tags: ruby

undefined method `init_gettext’ for ApplicationController:Class

In : ruby, Posted by admin on Oct.10, 2008

I just updated to rails 2.1.2 and see this error:

undefined method `init_gettext’ for ApplicationController:Class

To resolve it.

  1. make sure you have the latest gettext gems.
  2. if it does not help, try add this to the first line of your app/controllers/application.rb
    • require ‘gettext/rails’
Tags :


Cannot do “gem install mysql”

In : ruby, Posted by admin on Jan.01, 2008

If you cannot do “gem install mysql”, it returns:

/usr/local/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… yes
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Try this:

gem install mysql — \
> –with-mysql-include=/usr/include/mysql \
> –with-mysql-lib=/usr/lib/mysql

Tags :