zoukankan      html  css  js  c++  java
  • 无法在Mac Os下通过Gem安装Mysql

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

    Java代码 复制代码 收藏代码
    1. Building native extensions.  This could take a while...   
    2. ERROR:  Error installing mysql:   
    3.     ERROR: Failed to build gem native extension.   
    4.   
    5.         /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb   
    6. checking for mysql_query() in -lmysqlclient... no   
    7. checking for main() in -lm... yes   
    8. checking for mysql_query() in -lmysqlclient... no   
    9. checking for main() in -lz... yes   
    10. checking for mysql_query() in -lmysqlclient... no   
    11. checking for main() in -lsocket... no   
    12. checking for mysql_query() in -lmysqlclient... no   
    13. checking for main() in -lnsl... no   
    14. checking for mysql_query() in -lmysqlclient... no   
    15. checking for main() in -lmygcc... no   
    16. 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代码 复制代码 收藏代码
    1. export PATH=$PATH:/usr/local/mysql/bin   
    2. sudo gem install mysql -v '2.8.1'  

     

    问题解决:

    Java代码 复制代码 收藏代码
    1. Building native extensions.  This could take a while...   
    2. Successfully installed mysql-2.8.1  
    3. 1 gem installed   
    4. Installing ri documentation for mysql-2.8.1...   
    5. Installing RDoc documentation for mysql-2.8.1...  
  • 相关阅读:
    nat下没法ping通virutalbox中的centos7,解决共享文件夹问题
    深度学习的精确率和召回率,浅显的例子
    python发送邮件心得体会
    ubuntu 16.04 搭建tigervnc
    交叉编译7zip过程
    git使用经验汇总
    python 开发环境部署
    Ubuntu设置su和sudo为不需要密码 (摘录自别处)
    ubuntu 16.04 安装wechat, chrome等
    andorid开发build.gradle 增加几种产品的方法
  • 原文地址:https://www.cnblogs.com/bjanzhuo/p/3576116.html
Copyright © 2011-2022 走看看