shared items

Thursday, August 6, 2009

Rails 2.3 and Mysql 5.1

The title says it all. I wish Ruby on Rails wasn’t so difficult to get set up on Windows. It sounds like most Ruby on Rails developers are Mac OS X or Linux users.

I was just trying to get a basic app set up with MySQL 5.1, Rails 2.3 and Ruby 1.8.6 and got this error when trying to run rake db:migrate:

rake aborted!
undefined method `each’ for #

I found an answer here:

http://www.nabble.com/rake-aborted!-undefined-method-%60each%27-for–%3CMysql:-td20760472.html

Looks like most people uninstalled MySQL 5.1 and went back to 5.0. People also seemed to have better luck with Postgresql.

Source : http://peterskim.org/2009/04/12/mysql-51-with-rails-23ruby-186-on-windows-doesnt-work/

Also Comments :
I’m running MYSQL 5.1 and had a similar problem. I have Ruby 1.8.6. I followed these instructions and the undefined method error was resolved when running rake.
> The problem is that libmysql.dll shipped with Mysql doesn’t play well
> with ruby 2.2..
>
> The solution is to download the libmysql.dll from:
>
> http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll

2 comments:

zbang said...

http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/


for rails 2.3.2 and greater

zbang said...

Refer more here :
http://www.ruby-forum.com/topic/172179