Unable to install MySQL on Mac OS X

后端 未结 7 821
天涯浪人
天涯浪人 2021-01-13 10:49

I\'m having the exact issue as described in this question: MYSQL Installation Troubles. Unfortunately none of the answers helped me (and it\'s closed).

I try to learn

相关标签:
7条回答
  • 2021-01-13 11:08

    The correct gem to use is mysql2.

    0 讨论(0)
  • 2021-01-13 11:17

    I just end up with that problem using this command:

     sudo env ARCHFLAGS="-arch i386" gem install --no-rdoc --no-ri mysql -v 2.8.1 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
    

    Indeed I needed to install mysql gem version 2.8.1 on my mac OS X Leopard 10.5.8 running the mysql-5.6.2-m5-osx10.5-x86 from dmg file. I had the issue that it couldn't find libraries and I made some manipulations, then it couldn't install because of permissions. I found out that command, added the version I needed and changed architecture to the one corresponding to my mysql installation.

    So if somenone still wants to install that version :) let's try ! But we are not a lot installing this probably, and less on Leopard!

    0 讨论(0)
  • 2021-01-13 11:20

    In order to install the MySQL gem on OS X, you need to install the XCode developer tools that come on your installation disk. You can also download them from http://developer.apple.com.

    0 讨论(0)
  • 2021-01-13 11:23

    for some reason (maybe because i'm using rubygems 1.3.7 or installing mysql-2.8.1)

    sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
    

    did not work for me so after taking a look at gems/mysql-2.8.1/ext/mysql_api/extconf.rb i found out that the extconf.rb looks in the PATH for mysql_config so i tried

    export PATH=$PATH:/usr/local/mysql/bin
    sudo gem install mysql
    

    and did the job

    0 讨论(0)
  • 2021-01-13 11:25

    Are you on snow leopard? You have to execute the C dependencies compiles with x64 headers, try:

    sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
    
    0 讨论(0)
  • 2021-01-13 11:28

    I have run into issues with the MySQL gem myself and these are the only 2 links I actually bookmarked, so one of should have actually worked for me. Thought I'd share.

    1. http://wonko.com/post/how-to-install-the-mysqlruby-gem-on-mac-os-x-leopard
    2. http://rapd.wordpress.com/2007/05/17/battle-against-ror-gem-install-mysql/

    The second one is kind of old, so not sure if it still applies.

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