Can't install mysql gem on Mac OS X

后端 未结 3 916
南方客
南方客 2020-12-19 14:40

I installed the MySQL server with the installer from http://dev.mysql.com/downloads/mysql. Then, as explained in several guides, I wanted to install the mysql gem with the f

相关标签:
3条回答
  • 2020-12-19 14:47

    The problem is explained here: http://www.randomactsofsentience.com/2013/05/gem-install-mysql2-missing-mysqlh-on-os.html. In short:

    Change the file /usr/local/mysql/bin/mysql_config around line 120

    cflags="-I$pkgincludedir  -Wall -Wno-null-conversion -Wno-unused-private-field -Os -g -fno-strict-aliasing -DDBUG_OFF -arch x86_64 " #note: end space!
    cxxflags="-I$pkgincludedir  -Wall -Wno-null-conversion -Wno-unused-private-field -Os -g -fno-strict-aliasing -DDBUG_OFF -arch x86_64 " #note: end space!
    

    to

    cflags="-I$pkgincludedir  -Wall -Os -g -fno-strict-aliasing -DDBUG_OFF -arch x86_64 " #note: end space!
    cxxflags="-I$pkgincludedir  -Wall -Os -g -fno-strict-aliasing -DDBUG_OFF -arch x86_64 " #note: end space!
    
    0 讨论(0)
  • 2020-12-19 14:55

    I has problem when installing mysql2psql on Fedora 21 and I solve it by downloading mysql source tar.gz from mysql.org and set --with-mysql-config to this extracted directory to bin/mysql_config file

    gem install mysql2psql -- --with-mysql-config=/pathtodownloadedsource/mysql../bin/mysql_config

    0 讨论(0)
  • 2020-12-19 14:56

    The problem is not the gem itself. You are missing XCode (Install it from the AppStore) and possibly https://github.com/kennethreitz/osx-gcc-installer too as your error log says says:

    You have to install development tools first.

    For a better explanation of the problem, have a look at mkmf.log as the error log suggests as well.

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