gem install mysql failure in Snow Leopard

点点圈 提交于 2019-11-27 23:53:39

I think you should try to uninstall the old mysql gem first before recompiling

sudo gem uninstall mysql
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Installing the Xcode that's bundled with the Snow Leopard fixed the problem.

For me, it was adding the UNIX Tools option (if I recalled the name accurately), which include the headers. When I installed XCode originally, I didn't include this component because I didn't think that I would be writing UNIX code. Little did I know...

If you've installed MySQL 5 using MacPorts, then use the command:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5

I had this problem when I updated to Lion. In this case, I when to the app store and downloaded the latest Xcode. Then I uninstalled and reinstalled the database.

The issue had to do with a broken link during the update. Ruby likes to be in /System while Apple places ruby in /Developer.

was stuck with same problem: Tried most of the solution's: At the end

Edit the app/config/database.yml, change the adapter to mysql2

  production:
  adapter: mysql2
  database: commissi_production
  username: root
  password: root
  host: localhost

& run on terminal

 gem install activerecord-mysql2-adapter

Solved the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!