mysql2 gem Can't build native extensions

后端 未结 6 1846
离开以前
离开以前 2021-01-05 07:02

Our intern\'s computer is having problems installing the mysql2 gem. We just upgraded his computer from OS X 10.6 to 10.8 (Mountain Lion). I have tried installing mysql th

6条回答
  •  北海茫月
    2021-01-05 07:11

    I solved this by:

    1. Installing homebrew ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go) (check out their website for useage http://mxcl.github.com/homebrew/)
    2. Following these instructions http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion
    3. Reinstalling mysql with homebrew brew install mysql. (I tried installing mysql by follow these instructions http://erictarn.com/post/28269453881/how-i-installed-mysql-rvm-ruby-and-rails-on-mountain but i ran into issues later so i would recommend reinstalling mysql with homebrew.)
    4. Reinstalling rvm and rails and the gems for my project (which included mysql2)

    Note: When I tried to build I had a library issue, Library not loaded: libmysqlclient.18.dylib, which was fixed by running sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib (refer to Library not loaded: libmysqlclient.16.dylib error when trying to run 'rails server' on OS X 10.6 with mysql2 gem if you get the same issue.)

提交回复
热议问题