Hi Schalk
I had the same problem with rails 2.2.2 ...
ArgumentError (NULL pointer given):
(eval):3:in `each_hash'
(eval):3:in `all_hashes'
I my case I was running MySQL 5.1.30 on a Windows environment too so
I decided to switch 'back' to MySQL 5.0.67 and this worked for me. So
maybe this can help you or others solving the problem.
On Nov 26, 12:39 am, Schalk Neethling <[email protected]>
wrote:
> Hey All,
>
> Executing: gem install mysql --no-ri --no-rdoc tells me that it
> installed one gem without any errors. However looking at the folder
> inside InstantRails, something seems missing. There is no lib for example.
>
> Also, a simple line like this:
>
> @content = Content.find_by_permalink('introduction')
>
> Is throwing one heck of an error (here is a small bit of it):
>
> Processing ContentController#index (for 127.0.0.1 at 2008-11-26
> 01:17:28) [GET]
> [4;36;1mSQL (1.0ms) [0m [0;1mSET NAMES 'utf8' [0m
> [4;35;1mSQL (0.0ms) [0m [0mSET SQL_AUTO_IS_NULL=0 [0m
> [4;36;1mContent Columns (33.0ms) [0m [0;1mSHOW FIELDS FROM
> `contents` [0m
> [4;35;1mContent Load (1.0ms) [0m [0mSELECT * FROM `contents`
> WHERE (`contents`.`permalink` = 'introduction') LIMIT 1 [0m
>
> ArgumentError (NULLpointergiven):
> (eval):3:in `each_hash'
> (eval):3:in `all_hashes'
>
> C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:564:in
> `select'
> C:/InstantRails/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_query_cache'
> C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
> `select_all'
> C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in
> `cache_sql'
> C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
> `select_all'
> C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in
> `find_by_sql'
>
> No my first assumption is, this is related to a bad mysql gem
> installation but, for the sake of covering all basis, does anyone know
> whether anything has changed in the way databases get's set-up in the
> database.yml file in 2.2.2?
>
> Current:
>
> development:
> adapter: mysql
> encoding: utf8
> database: osc_development
> username: user
> password: pass
> host: localhost
>
> Thanks for all assistance, thankfully I now see that it is not only me
> struggling with this issue.
> Schalk
>
> CharlesB wrote:
>
> > I had the same exact error message when I first tried to install the
> > mysql-2.7.3 gem. But from the error message, we clearly see that only
> > the RDocs are not being installed.
>
> > You can confirm that if you do a "gem list". If you want, you can
> > simply do:
>
> > gem install mysql --no-ri --no-rdoc
>
> > It will install the gem, but not the documentation (which, from a
> > Rails point of view, you should not be concerned about anyway).
>
> > Other than that, if Rails 2.2.2 still fails to load, then either you
> > have not installed MySQL server itself, or somehow libmysql.dll is not
> > on the path list. Simply type "path" at the command prompt and check
> > if your mysql\bin directory is listed there. If not, add it.
>
> > Cheers!
>
> > CharlesB
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---