简体   繁体   English

Rails 3.0.3,Ruby 1.8.7(Cygwin),Windows 7 64位,MySQL 5.5。 -MySQL gem无法安装

[英]Rails 3.0.3, Ruby 1.8.7 (Cygwin), Windows 7 64-bit, MySQL 5.5. - MySQL gem fails to install

I'm trying to install the MySQL Gem for Ruby on Rails on Windows 7 64-bit. 我正在尝试在Windows 7 64位系统上为Ruby on Rails安装MySQL Gem。 I've installed MySQL Essential 5.1.54 Winx64 from the MySQL website. 我已经从MySQL网站安装了MySQL Essential 5.1.54 Winx64。 I've installed Cygwin, which comes with ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]. 我已经安装了Cygwin,它随附有ruby 1.8.7(2008-08-11补丁程序级别72)[i386-cygwin]。 I've installed Rails 3.0.3 from the rails website. 我已经从rails网站安装了Rails 3.0.3。 When I do 'gem install mysql', it outputs: 当我执行“ gem install mysql”时,输出:

Building native extensions.   This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension

/usr/bin/ruby.exe extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsnl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... 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.

I've downloaded the Instant Rails libmySQL.dll and replaced that in my MySQL directory(C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin). 我已经下载了Instant Rails libmySQL.dll,并将其替换为我的MySQL目录(C:\\ Program Files \\ MySQL \\ MySQL Server 5.1 \\ bin)。 I have a /etc/my.cnf that points to using 127.0.0.1 as the mysql host. 我有一个/etc/my.cnf,它指向使用127.0.0.1作为mysql主机。 I can connect to mysql in my cygwin bash shell. 我可以在cygwin bash shell中连接到mysql。 I can connect to mysql in a Command Prompt window. 我可以在“命令提示符”窗口中连接到mysql。 I can start rails using SQLite3 as the database. 我可以使用SQLite3作为数据库来启动Rails。 I've tried supplying --with-mysql-dir=C:\\Program Files\\MySQL\\MySQL Server 5.1\\bin to the gem install. 我尝试提供--with-mysql-dir = C:\\ Program Files \\ MySQL \\ MySQL Server 5.1 \\ bin到gem安装。

试试--with-mysql-dir = C:\\ Program Files \\ MySQL \\ MySQL Server 5.1,祝您好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM