答复: 升级2.2后mysql驱动的问题

windows 安装了 mysql gem后出错,错误提示大概是:
ArgumentError (NULL pointer given):
     (eval):3:in `each_hash'
     (eval):3:in `all_hashes'

 

 

感觉这是windows下mysql gem的问题
如果libmysql.dll的版本不对的话(或者mysql安装目录有空格?)
就会出这个错

我的是windows vista, mysql 5.1.30,直接copy mysql/bin/libmysql.dll到ruby/bin不管用,找下面的办法,从instantrails那里找个libmysql.dll放到ruby/bin里面管用了


搜来一个管用的办法:http://www.ruby-forum.com/topic/172179

If you are having problems with MySQL, getting errors like: �The
bundled mysql.rb driver has been removed from Rails 2.2. Please
install the mysql gem and try again: gem install mysql.� �C:/ruby/lib/
ruby/gems/1.8/gems/mysql-2.7.3-x86-mswin32/ext/mysql.so�

Here is the solution: 1) First, gem install mysql. If this doesn�t
help continue� 2) Copy libmysql.dll from InstantRails (see below) to
your mysql directory (C:\mysql\bin\). Restart your computer and it
should be working.

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

你可能感兴趣的:(mysql,windows,SVN,Ruby,Rails)