繁体   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

我正在尝试在Windows 7 64位系统上为Ruby on Rails安装MySQL Gem。 我已经从MySQL网站安装了MySQL Essential 5.1.54 Winx64。 我已经安装了Cygwin,它随附有ruby 1.8.7(2008-08-11补丁程序级别72)[i386-cygwin]。 我已经从rails网站安装了Rails 3.0.3。 当我执行“ 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.

我已经下载了Instant Rails libmySQL.dll,并将其替换为我的MySQL目录(C:\\ Program Files \\ MySQL \\ MySQL Server 5.1 \\ bin)。 我有一个/etc/my.cnf,它指向使用127.0.0.1作为mysql主机。 我可以在cygwin bash shell中连接到mysql。 我可以在“命令提示符”窗口中连接到mysql。 我可以使用SQLite3作为数据库来启动Rails。 我尝试提供--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