I think the solution suggested by - CharlesB (25 Nov) is pretty
straight forward. Somehow the incomplete installation of mysql gem,
doesnt has the chance to add mysql's bin directory path to windows
environment variable "Path".
Simply put a an additional entry there, i.e. in my case "C:\wamp\bin
\mysql\mysql5.0.51b\bin" & vola! it works.

for someone like my colleague, (called me to help on the issue) who
doesnt knows how to do it,

right click the 'My Computer' (desktop icon) or  'Computer' ( in start
menu)
Choose 'Advance System Settings' from left panel
>From the 'System Properties' window select 'Advanced' tab,
click 'environment variables' button
locate 'Path' variable, usually in 'System Variables'
click 'Edit'
Add your Mysql's bin directory path to it i.e. ';C:\wamp\bin\mysql
\mysql5.0.51b\bin;"
click OK, OK

run the migration, it should work now.




copying & pasting the libmysql.dll file from mysql\bin directory to
ruby\bin is another workaround, reported by Ed from ruby-forum, but I
like the above solution, as it caters to the deficency left by
incomplete installation of gem install mysql.

On Dec 13, 4:31 am, TonyB <tony.bus...@gmail.com> wrote:
> 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 <volume4.sch...@gmail.com>
> 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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to