I''m struggling with several problems getting my first time ruby on rails environment running. I''m now stuck on this problem too. rake db:migrate generates the following error. This one is on a vista machine. Anyone seen this before. Any thoughts or advice? Reading about Ruby on Rails has really got me excited to give it a try. But in practice getting to the point that I can actually use RoR has almost burned me out. I never thought the transition from C# in a VS08 to RoR would be so frustrating - particularly creating the environment. ********************************** C:\Users\David\Documents\Rails\mydemo>rake db:migrate --trace (in C:/Users/David/Documents/Rails/mydemo) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! undefined method `each'' for #<Mysql:0x5cdda84> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:414:in `tables'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:330:in `initialize_schema_migrations_ '' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:430:in `initialize'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:394:in `new'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:394:in `up'' c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb:377:in `migrate'' c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:111 c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'' c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'' c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31 c:/ruby/bin/rake:16:in `load'' c:/ruby/bin/rake:16 ****************************** -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David Franklin wrote:> > I''m struggling with several problems getting my first time ruby on rails > environment running. I''m now stuck on this problem too. > > rake db:migrate generates the following error. This one is on a vista > machine. Anyone seen this before. Any thoughts or advice? > > Reading about Ruby on Rails has really got me excited to give it a try. > But in practice getting to the point that I can actually use RoR has > almost burned me out. I never thought the transition from C# in a VS08 > to RoR would be so frustrating - particularly creating the environment. > > > ********************************** > > C:\Users\David\Documents\Rails\mydemo>rake db:migrate --trace > (in C:/Users/David/Documents/Rails/mydemo) > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:migrate > rake aborted! > undefined method `each'' for #<Mysql:0x5cdda84> > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:414:in > `tables''What version of MySQL is this? I have had similar problems with MySQL 5.1 and the mysql gem with ActiveRecord. Switching back to MySQL version 5.0.67 and re-installing the MySQL gem seemed a lot better. I mainly use postgresql anyway which has no such problem nuder Windows or Linux. Cheers, Gary. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David Franklin
2008-Nov-30 18:40 UTC
Re: rake aborted! undefined method `each'' for #<Mysql:
Gary Doades wrote:> David Franklin wrote: >> to RoR would be so frustrating - particularly creating the environment. >> rake aborted! >> undefined method `each'' for #<Mysql:0x5cdda84> >> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:414:in >> `tables'' > > What version of MySQL is this? I have had similar problems with MySQL > 5.1 and the mysql gem with ActiveRecord. Switching back to MySQL version > 5.0.67 and re-installing the MySQL gem seemed a lot better. > > I mainly use postgresql anyway which has no such problem nuder Windows > or Linux. > > Cheers, > Gary.It''s MySQL 5.1. I''ll try backing out to MySQL 5.0 and reinstall the gem. Thanks for the help. I was naive about how challenging setting up the environment would be. I''ll keep you posted. Thanks again. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David Franklin wrote:> Gary Doades wrote: > >> David Franklin wrote: >> >>> to RoR would be so frustrating - particularly creating the environment. >>> rake aborted! >>> undefined method `each'' for #<Mysql:0x5cdda84> >>> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:414:in >>> `tables'' >>> >> What version of MySQL is this? I have had similar problems with MySQL >> 5.1 and the mysql gem with ActiveRecord. Switching back to MySQL version >> 5.0.67 and re-installing the MySQL gem seemed a lot better. >> >> I mainly use postgresql anyway which has no such problem nuder Windows >> or Linux. >> >> Cheers, >> Gary. >> > > > It''s MySQL 5.1. I''ll try backing out to MySQL 5.0 and reinstall the > gem. Thanks for the help. I was naive about how challenging setting up > the environment would be. > > I''ll keep you posted. > > Thanks again. >If you continue to have problems with a migration it would probably help if you posted the migration file contents. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
katari-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Dec-03 01:32 UTC
Re: rake aborted! undefined method `each'' for #<Mysql:
Gary, Good suggestion. I had the same problem with mysql 5.1, but the problem disappeared going back to 5.0. I am using Windows XP, the latest Rails (2.2, or is it 2.1?), and Ruby 1.8.6. One thing that I also do is to put the libmysql.dll file in c:\ruby \bin. It is a bit of voodo that I read about in a post that I cannot find anymore. Is there a version of the ruby mysql gem out there that will work with Mysql5.1 on windows? I would love to hear from the group, because I am eager to try out the horizontal partitioning capabilities of MySql 5.1. Kaushik On Nov 30, 10:40 am, David Franklin <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Gary Doades wrote: > > David Franklin wrote: > >> to RoR would be so frustrating - particularly creating the environment. > >> rake aborted! > >> undefinedmethod`each'' for #<Mysql:0x5cdda84> > >> c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:414:in > >> `tables'' > > > What version of MySQL is this? I have had similar problems with MySQL > > 5.1 and the mysql gem with ActiveRecord. Switching back to MySQL version > > 5.0.67 and re-installing the MySQL gem seemed a lot better. > > > I mainly use postgresql anyway which has no such problem nuder Windows > > or Linux. > > > Cheers, > > Gary. > > It''s MySQL 5.1. I''ll try backing out to MySQL 5.0 and reinstall the > gem. Thanks for the help. I was naive about how challenging setting up > the environment would be. > > I''ll keep you posted. > > Thanks again. > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
katari-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Gary, > Good suggestion. I had the same problem with mysql 5.1, but the > problem disappeared going back to 5.0.Although i was using 5.0 , that didnt disappeared in my environment... then i relaized that i was using 5.0.24 but mysql ruby gem (2.7.3) is supporting 5.0.27... I just upgraded to that version of mysql server and problem solved...> > I am using Windows XP, the latest Rails (2.2, or is it 2.1?), and Ruby > 1.8.6.mine is vista.... rails : 2.2 , ruby:1,8,6> > One thing that I also do is to put the libmysql.dll file in c:\ruby > \bin. It is a bit of voodo that I read about in a post that I cannot > find anymore.I did the same...> > Is there a version of the ruby mysql gem out there that will work with > Mysql5.1 on windows? I would love to hear from the group, because I am > eager to try out the horizontal partitioning capabilities of MySql > 5.1. >you can check it here... I couldnt find anything regarding to Mysql 5.1 mesut www.zerobuffer.com> Kaushik > > On Nov 30, 10:40�am, David Franklin <rails-mailing-l...@andreas-s.net>-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mesut Çelik wrote:> you can check it here... I couldnt find anything regarding to Mysql 5.1missing url : http://tmtm.org/mysql/ruby/README.html> > mesut > www.zerobuffer.com > >> Kaushik >> >> On Nov 30, 10:40�am, David Franklin <rails-mailing-l...@andreas-s.net>-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
James Masters
2008-Dec-23 05:00 UTC
Re: rake aborted! undefined method `each'' for #<Mysql:
Gary Doades wrote:> What version of MySQL is this? I have had similar problems with MySQL > 5.1 and the mysql gem with ActiveRecord. Switching back to MySQL version > 5.0.67 and re-installing the MySQL gem seemed a lot better.Rolling back to 5.0.67 also worked for me. Thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The last suggestion that recommended downloadling libmysql.dll worked for me. Thanks! bflower-4iK2G3VhlDjvnOemgxGiVw@public.gmane.org wrote:> 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 > > and save this in your ruby bin directory > > see also: > http://forums.aptana.com/viewtopic.php?f=20&t=7563&p=27407&hilit=libmysql.dll#p27407 > > > > On Dec 1 2008, 5:22�am, David Franklin <rails-mailing-l...@andreas--- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David Triebwasser
2009-Mar-08 20:12 UTC
Re: rake aborted! undefined method `each'' for #<Mysql:
thanks to all the suggestions and the link to the older libmysql.dll. I placed it in my ruby/bin and migration succeeded. I had mysql 5.1.32-community ruby 1.8.6 rails 2.2.2 on windows xp and was getting this error using rake db:migrate --trace rake aborted! undefined method `each'' for #<Mysql:0x4873184> I had to drop the preexisting tables and also remove the create_[table] rb files generated initially. I''m following the tutorial at http://www.tutorialspoint.com/ruby-on-rails/ Madhav Ruby wrote:> The last suggestion that recommended downloadling libmysql.dll worked > for me. > Thanks! > > bflower-4iK2G3VhlDjvnOemgxGiVw@public.gmane.org wrote: >> 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 >> >> and save this in your ruby bin directory >> >> see also: >> http://forums.aptana.com/viewtopic.php?f=20&t=7563&p=27407&hilit=libmysql.dll#p27407 >> >> >> >> On Dec 1 2008, 5:22�am, David Franklin <rails-mailing-l...@andreas--- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Kevin Kleinfelter
2009-Apr-12 21:04 UTC
Re: rake aborted! undefined method `each'' for #<Mysql:
If you get "rake aborted! undefined method `each'' for..." on Windows (win32), it is almost certainly a mismatch between the version of MySQL and the version of the gem. Looking at the readme inside the .gem, it says that the gem was compiled against MySQL 5.0.27. V2.7.3 of the pre-compiled gem will NOT work with MySQL 5.1. If you''re going to use the pre-compiled V2.7.3 Windows gem, you''ll have to use MySQL 5.0.27. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Damaris Fuentes
2009-May-14 14:11 UTC
Re: rake aborted! undefined method `each'' for #<Mysql:
You can use MySQL 5.1 if you don''t install mysql gem v2.7.3. It is strange because, if you don''t install this version, some warnings appear related to it, saying that the bundled-in mysql gem is going to be deprecated and you are encouraged to install the latest gem (apparently, the 2.7.3 one...) Kevin Kleinfelter wrote:> If you get "rake aborted! undefined method `each'' for..." on Windows > (win32), it is almost certainly a mismatch between the version of MySQL > and the version of the gem. Looking at the readme inside the .gem, it > says that the gem was compiled against MySQL 5.0.27. V2.7.3 of the > pre-compiled gem will NOT work with MySQL 5.1. > > If you''re going to use the pre-compiled V2.7.3 Windows gem, you''ll have > to use MySQL 5.0.27.-- Posted via http://www.ruby-forum.com/.