Sanjay Tibrewal
2009-Feb-25 23:42 UTC
Error accessing db through model - Rails 2.2.2, MySql 5.1.30
Folks, I just installed Rails 2.2.2 on my box and MySql 5.1.30. Running a simple <Model>.find(:all) gives me a bunch of errors - snippet below. The only answer I have found in searching around is to go back to an older version of MySql. Is there any way to fix this or do I really have to revert the MySql version?>> Meal.find(:all)ArgumentError: NULL pointer given from (eval):3:in `each_hash'' from (eval):3:in `all_hashes'' from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record /connection_adapters/mysql_adapter.rb:564:in `select'' from C:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record /connection_adapters/abstract/database_statements.rb:7:in `select_all_without_qu ery_cache'' Thanks for your help. -S -- 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 -~----------~----~----~----~------~----~------~--~---
jemminger
2009-Feb-26 02:41 UTC
Re: Error accessing db through model - Rails 2.2.2, MySql 5.1.30
Have you created the database and migrated? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jeff Emminger wrote:> Have you created the database and migrated?Yes Jeff, I have been able to create a database and run db:migrate successfully. I can see the tables in db and can also run direct sql queries successfully. Forgot to add to my initial post - I am on Win XP. -- 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 -~----------~----~----~----~------~----~------~--~---
Is it possible that you need to re-install the mysql gem? I think you said you upgraded MySQL but you didn''t say from what version. I know the mysql gem includes a C component that hooks in to the MySQL library, this might be the source of your problem. On Feb 25, 8:04 pm, Sj Tib <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Jeff Emminger wrote: > > Have you created the database and migrated? > > Yes Jeff, I have been able to create a database and run db:migrate > successfully. I can see the tables in db and can also run direct sql > queries successfully. > > Forgot to add to my initial post - I am on Win XP. > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Rick wrote:> Is it possible that you need to re-install the mysql gem? I think you > said you upgraded MySQL but you didn''t say from what version. I know > the mysql gem includes a C component that hooks in to the MySQL > library, this might be the source of your problem.Thanks Rick. I reinstalled the MySql gem before the initial post. That gem installation was causing errors with RDoc installation (as reported by others as well) so I installed it with "gem install mysql --no-ri --no-rdoc". When you google the error I am getting, it has been reported by other folks too so it seems like something related to how Rails 2.2.2 and MySql 5.1.30 interact. The only solution I have found others suggest is to install an older version of MySql 5.1.30. BTW - I didn''t have an older version installed. I am starting with MySql 5.1.30 -- 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 -~----------~----~----~----~------~----~------~--~---
Sj Tib wrote:> Rick wrote: >> Is it possible that you need to re-install the mysql gem? I think you >> said you upgraded MySQL but you didn''t say from what version. I know >> the mysql gem includes a C component that hooks in to the MySQL >> library, this might be the source of your problem. > > Thanks Rick. I reinstalled the MySql gem before the initial post. That > gem installation was causing errors with RDoc installation (as reported > by others as well) so I installed it with "gem install mysql --no-ri > --no-rdoc". > > When you google the error I am getting, it has been reported by other > folks too so it seems like something related to how Rails 2.2.2 and > MySql 5.1.30 interact. The only solution I have found others suggest is > to install an older version of MySql 5.1.30. BTW - I didn''t have an > older version installed. I am starting with MySql 5.1.30I installed an older version of MySql (5.0.77) and it works like a charm. Not sure what is the issue with Rails 2.2.2 and MySql 5.1.30. -- 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 -~----------~----~----~----~------~----~------~--~---