我试图安装mysql2:无法安装mysql2 gem。安装找不到mysql.h中
sudo gem install mysql2 -v '0.2.7' -- --with-mysql-config=/usr/local/Cellar/mysql/5.5.25a/bin/mysql_config
我得到这个错误:
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb -- with-mysql-config=/usr/local/Cellar/mysql/5.5.25a/bin/mysql_config
checking for rb_thread_blocking_region()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** 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.
我的MySQL安装是通过酿造,所以我的mysql.h文件位于:
/usr/local/Cellar/mysql/5.5.25a/bin/mysql_config
这就是为什么我有与MySQL的,配置标志
在mysql_config文件正在寻找的mysql.h文件位置:
$basedir/include/mysql/mysql.h
应该补充,我更新了我的Gemfile从
宝石 'mysql2
到创业板mysql2',' 0.2 0.7'
,因为我得到有关mysql2 0.3事实上,一些弃用警告。*没有有效记录的支持。所以要么升级到3.1或降级mysql2。我选择了后者。
我应该编辑mysql_config还是有别的东西,我可以做些什么来解决这个问题?谢谢你的帮助。
你最近从OS X Snow Leopard升级到狮子还是山狮?如果是这样,您需要更新到最新版本的XCode,并确保安装了命令行工具(更新后,XCode中的一个选项)。 –
不,我没有。我要更新我的职务的事实,我更新,由创业板“mysql2”创业板“mysql2”我的Gemfile,“0.2.7” – isea
嗯 - 我目前mysql2的版本是0.3.11 - 你可能要“gem uninstall mysql2”,然后看看它是否用更新的版本构建。 –