Installing mysql2 gem on Mac os x Lion

后端 未结 4 1125
广开言路
广开言路 2021-02-10 09:12

The other day I updated to Mac OSX Lion. It broke my rails install as I had to re complie mysql. While I have got that working reinstalling the mysql2 gem has become problematic

4条回答
  •  长情又很酷
    2021-02-10 09:41

    I got this installed in the system Ruby (1.8.7 on Lion) as follows:

    1. Install 64-bit MySQL 5.5.19 64-bit from the .dmg
    2. Add /usr/local/mysql/lib to your DYLD_LIBRARY_PATH (I prefer this to the symbolic link solution but they should be equivalent). I did this in my .bash_profile via:

      export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
      
    3. Execute:

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

提交回复
热议问题