Tag:blog http io for Issues cti new sql
rails new demo--database=mysql last error
Gem files would remain installed in d:/billfiles/rails_dev/ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.15 for Inspection.
Results logged to D:/BILLFILES/RAILS_DEV/RUBY193/LIB/RUBY/GEMS/1.9.1/EXTENSIONS/X86-MINGW32/1.9.1/ Mysql2-0.3.15/gem_make.out
An error occurred while installing MYSQL2 (0.3.15), and bundler cannot continue.
Make sure that ' gem install mysql2-v ' 0.3.15 ' succeeds before bundling.
But after executing this sentence, it is an error, which indicates that it is driving the problem
and then see this article http://blog.mmediasys.com/2011/07/07/ installing-mysql-on-windows-7-x64-and-using-ruby-with-it/
finally found that his ruby193 is 32 bits, MySQL is 64 bits, so Ruby is not connected, So download the 32-bit MySQL driver http://dev.mysql.com/downloads/connector/c/
Select 32-bit zip, unzip and place in the C packing directory, rename to
Mysql-connector-c-noinstall-6.0.2-win32
gem install mysql2 -- --with-mysql-lib="c:\mysql-connector-c-noinstall-6.0.2-win32\lib" --with-mysql-include="c:\mysql-connector-c-noinstall-6.0.2-win32\include" --with-mysql-dir="c:\mysql-connector-c-noinstall-6.0.2-win32"
最后把其中lib目录中的
mysql-connector-c-noinstall-6.0.2-win32\lib中的
libmysql.dll拷贝到ruby下面的bin目录
终于OK!