mysql - 创建 Rails 新应用程序时无法安装 mysql2

标签 mysql makefile

使用 mysql 作为数据库创建 Rails 应用程序时,出现以下错误

...
...
Installing mysql2(0.3.13)
Gem:Installer::ExtensionBuilderError: ERROR: Failed to build gem native extension
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
checking for rb_thread_blocking_region
checking for rb_wait_for_single_fd<>... yes
checking for rb_has_dup<>... yes
checking for rb_intern3<>... yes
***extconf.rb failed ***
Could not create Makefile due to some reasons, probably lack of necessary libraries and/or headers. Check the mkmf.log for more details. You may need configuration options

但是,如果我使用默认的sqlite数据库,就没有问题

My OS & MySQL information
OS:Winodows 8 64bit
MySQL: 5.6(64 bit)

最佳答案

不幸的是 mysql2 gem 有问题,您现在必须安装 mysql gem,为此,请在 config/database.yml 和 gemfile 中从 mysql2/sqlite 修改为 mysql 后进行捆绑安装,希望这是清楚的。

关于mysql - 创建 Rails 新应用程序时无法安装 mysql2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17922277/

相关文章:

MYSQL - 如果每个日期计数器都符合条件,则显示 2 个日期之间的数据

Makefile:是否可以有带斜杠的词干?

linux - 用于 aws-iot-device-sdk-cpp 的 Buildroot MakeFile

c - 使用 makefile 进行多次编译

mysql - 如何检索mysql中所有记录的树节点数?

php - 最快与最好 ​​- 唯一索引或检查是否存在

makefile - 如何将 .cma 文件链接到我自己的 Frama_C 插件?

docker - Makefile无法执行sudo docker kill

mysql - 一般 MYSQL 数据库了解

MySQL Performance Schema 语句 DIGEST