因此,我使用以下命令安装了 mysql gem:
gem install mysql --platform=ruby -- --with-mysql-dir=C:/mysql-connector-c-noinstall-6.0.2-win32
所以我得到了以下错误日志:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.C:/Ruby187/bin/ruby.exe extconf.rb --with-mysql-dir=C:/mysql-connector-c
-noinstall-6.0.2-win32 checking for main() in -llibmysql... no * extconf.rb failed * Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby187/bin/ruby
--with-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-libmysqllib
--without-libmysqllibGem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/mysql-2.9.1 for inspection. Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/mysql-2.9.1/ext/mysql_api/ge m_make.out
其他信息: Ruby版本1.8.7 Windows 7 64位操作系统 Mysql版本5.1