升級rails版本和Gem版本時,先
gem update rails
gem update
然後它會出現mysql的驅動錯誤的提示如下:
問題: 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
答案:
我在電腦上解決成功的方法:gem install mysql 然後直接copy instantrails中的/mysql/bin/libmysql.dll,放進"/ruby/bin"
********
感覺這是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/