MySQL2 Ruby gem will not Install 10.6

前端 未结 2 941
梦毁少年i
梦毁少年i 2020-12-30 13:30

I know this has been asked several times, but I searched and I tried many different things and nothing worked.

ERROR:  Error installing mysql2:
    ERROR: Fa         


        
相关标签:
2条回答
  • 2020-12-30 14:08

    This blog post solved a similar if not the same problem that I was having.

    You need to install libmysqlclient-dev in order to build the mysql2 gem.

    0 讨论(0)
  • 2020-12-30 14:17

    I had the exact same problems. I resolved them by uninstalling MySQL completely, reinstalling the 64 bit version and installing the mysql2 gem with options pointing to the MySQL install.

    I followed some instructions I found at petermac.com:

    1. Uninstall MySQL:

    sudo rm /usr/local/mysql
    sudo rm -rf /usr/local/mysql*
    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    
    edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
    
    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /Library/Receipts/MySQL*
    

    2. Install MySQL 64 bit edition

    3. Install mysql2 gem

    sudo env ARCHFLAGS="-arch x86_64" gem install mysql2 -- \
      --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \
      --with-mysql-include=/usr/local/mysql/include
    

    That should at least get the gem installed :)

    0 讨论(0)
提交回复
热议问题