Installation : undefined method 'each'

Added by ABC DEF over 11 years ago

I'm trying to install Redmine for the first time on a WAMP environment
When I run (in a simple cmd prompt)
rake db:migrate RAILS_ENV="production"
I get the following error message
rake aborted!
undefined method `each' for #<Mysql:0x57a8a8c>

My WAMP environment (installed through WAMPSERVER) is the following
Windows VISTA / Apache 2.2.11 / PHP 5.2.9-2 / MySQL 5.1.33

And my Rails config is
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
Rails 2.2.2

Thanks in advance
Benoit

I've tried rake db:migrate_plugins but I get a segmentation fault when doing so
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/paths.rb:100: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i386-mswin32]

Replies (2)

RE: Installation : undefined method 'each' - Added by Nicolas Zinopoulos over 11 years ago

Benoit de Malartic wrote:

I'm trying to install Redmine for the first time on a WAMP environment
When I run (in a simple cmd prompt)
rake db:migrate RAILS_ENV="production"
I get the following error message
rake aborted!
undefined method `each' for #<Mysql:0x57a8a8c>

My WAMP environment (installed through WAMPSERVER) is the following
Windows VISTA / Apache 2.2.11 / PHP 5.2.9-2 / MySQL 5.1.33

And my Rails config is
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
Rails 2.2.2

Thanks in advance
Benoit

I've tried rake db:migrate_plugins but I get a segmentation fault when doing so
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_view/paths.rb:100: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i386-mswin32]

Hello Benoit,

I encountered exactly the same problem trying to install Redmine (trunk revision 2679) under Windows Server 2003.
After sifting the threads in various fora, I found a message explaining that the problem was MySQL 5.1.x and that downgrading to MySQL 5.0 solved it (see http://www.redmine.org/boards/2/topics/5562 for a start).
Doing that, solved the problem for me as well. I am nevertheless intrigued about it as I had previously successfully installed and tested Redmine on a Windows XP Professional SP2 laptop with MySQL 5.1.32 !

Good luck!

Nicolas

RE: Installation : undefined method 'each' - Added by Vladimir Potekhin over 11 years ago

ERROR: undefined method `each' for #<Mysql ???>

This is because mysql.so from gems compiled with old version of libmysql.dll from mysql server.
In most case libmysql.dll is newest then mysql.so
You neet to obtain "old" version of libmysql.dll, for example from old version of mysql server, and put libmysql.dll to the top of redmine directory and restart all redmine services:
  • redmine/
  • * app/*
  • * conf/*
  • * ...
  • * vendor/*
  • * libmysql.dll <- put it here

(1-2/2)