“gem install mysql2” on Mac with MAMP 2.2

走远了吗. 提交于 2019-12-03 21:32:09

Have you considered installing MySQL with homebrew (http://brew.sh/)? MAMP stands for Mac-Apache-MySQL-PHP (the last part of this being the most important). I would suggest just installing MySQL directly on your box (homebrew takes care of all the heavy lifting) and afterwards I doubt you'll have any difficulty installing that gem.

To install homebrew --

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Run brew doctor follow any instructions and then afterwards to install MySQL run brew install mysql and follow any of the instructions it provides for setting up a user, etc...

============= UPDATE ==============

SO, what you'll want to do is use brew this way to install MySQL and then install the gem in the normal fashion - sudo gem install mysql2 assuming this works, then you will be able to switch back to the old MySQL install through MAMP via -

sudo nano /etc/paths

then add this line to the top of the document -

/Applications/MAMP/Library/bin

restart your terminal and then run mysql to double check that you are using the MAMP installation of MySQL, and you'll be good to go.

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