Zagstrug
Zagstrug

Reputation: 1729

Installing MySQL Gem for Mac OS X

I know there are a lot of questions like this already, but I'm looking for the SIMPLEST way to install the MySql gem + all the dependencies that are required for its successful installation on Mac OS X 10.8.2.

gem install ruby-mysql hasn't worked, I've gotten many different errors, either with "Not the correct permissions" or "Error in " from not having the dependencies

Upvotes: 2

Views: 1127

Answers (2)

Sonu Kumar
Sonu Kumar

Reputation: 396

To fix for a manual gem install:

brew install openssl
brew install mysql
gem install mysql2 -- --with-opt-dir="$(brew --prefix openssl)"

To fix for all bundle installs:

brew install openssl
brew install mysql
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)"
bundle install

Upvotes: 1

irosenb
irosenb

Reputation: 868

If you have Homebrew installed (if not, click the link and follow those directions), you can do brew install mysql and that should get you the right dependencies.

Upvotes: 6

Related Questions