>  기사  >  데이터 베이스  >  无法在Mac Os下通过Gem安装Mysql的问题_MySQL

无法在Mac Os下通过Gem安装Mysql的问题_MySQL

WBOY
WBOY원래의
2016-06-01 13:36:201199검색

bitsCN.com

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

 

在Mac Os下通过Gem安装Mysql时,老是报错:

Java代码  

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,于是执行:

 

Java代码  

export PATH=$PATH:/usr/local/mysql/bin  

sudo gem install mysql -v '2.8.1'  

 

问题解决:    

 

Java代码  

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...  

 

bitsCN.com
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.