[英]Ruby on Rails: How do I install the mysql gem on 10.6.7 Mac OS X (64bit)
There seem to be a bunch of blogs and instructions out there to do this, but I think a large issue with them is that they don't specify architecture.. they assume 32bit... which makes me sad =( 似乎有很多博客和说明可以做到这一点,但是我认为与它们有关的一个大问题是,它们没有指定体系结构。它们假定为32位...这让我很伤心=(
Anyone know a good way to install the mysql connector / gem on 64bit snow leopard? 有人知道在64位雪豹上安装mysql连接器/ gem的好方法吗? Note: I already have mySQL, and it works just fine. 注意:我已经有了mySQL,并且工作正常。
EDIT: 编辑:
% sudo gem install mysql
Password:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
Edit # 2 编辑#2
% sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
I found it. 我找到了。 I hope this helps other people who are having issues: 我希望这对遇到问题的其他人有所帮助:
export ARCHFLAGS="-arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -v 2.7 -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config
got it from this article: 从本文获得:
http://www.milindspandit.org/blog/?category_name=technical http://www.milindspandit.org/blog/?category_name=technical
I used macports to install mysql, which provides the necessary header files to compile the mysql gem using gem install mysql
. 我使用macports安装mysql,它提供了必要的头文件,可使用gem install mysql
编译mysql gem。 I know my mysql installation is 64-bit ( file /path/to/mysql
reports Mach-O 64-bit executable x86_64
). 我知道我的mysql安装是64位的( file /path/to/mysql
报告Mach-O 64-bit executable x86_64
)。 I assume the mysql gem is too. 我认为mysql gem也是。 I hope this is what you're looking for. 我希望这是您要寻找的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.