2013-05-10 112 views
4

我跟着「http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/」設置on Rails應用程序和MySQL服務器5.1錯誤:錯誤安裝MySQL:錯誤:未能建立寶石原生擴展

所以紅寶石之間的連接,當我安裝mysql的寶石具有以下命令:

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-libmysqllib

Gem 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

回答

4
  1. 下載mysql/C連接器Zip文件。

  2. 解壓縮到特定文件夾說C: drive

  3. 複製libmySQL.dll from mysql/C連接器的Zip文件。

  4. 試試這個命令gem install mysql --platform=ruby - --with- mysql-lib=C:\mysql-C-connector\lib --with- mysql-include=c:\mysql-C-connector\include

+0

當烏爾ANS是文本沒有必要在HTML中包括欽傑標籤。沒有需要使用標籤 – 2013-09-11 08:15:18

相關問題