`
thierry.xing
  • 浏览: 665138 次
  • 性别: Icon_minigender_1
  • 来自: 北京
博客专栏
580fa9c1-4a0c-3f40-a55a-c9256ce73302
Sencha Touch中...
浏览量:0
社区版块
存档分类
最新评论

无法在Mac Os下通过Gem安装Mysql

 
阅读更多

在Mac Os下通过Gem安装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
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 -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no

 

 貌似是缺少了某些文件导致的,于是看了看/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb发现extconf.rb好像需要Mysql的PATH,于是执行:

 

export PATH=$PATH:/usr/local/mysql/bin
sudo gem install mysql -v '2.8.1'

 

问题解决:

 

Building native extensions.  This could take a while...
Successfully installed mysql-2.8.1
1 gem installed
Installing ri documentation for mysql-2.8.1...
Installing RDoc documentation for mysql-2.8.1...

 

 

1
0
分享到:
评论
2 楼 thierry.xing 2013-02-10  
lizhongnan 写道
推荐用 macport 或者 brew 安装,稍微简单点!

brew确实不错,比较省事
1 楼 lizhongnan 2013-02-02  
推荐用 macport 或者 brew 安装,稍微简单点!

相关推荐

Global site tag (gtag.js) - Google Analytics