Alex Harvey
Alex Harvey

Reputation: 15472

Unable to install Ruby MySQL Gem on Mac OS X

When attempting to install the Ruby MySQL Gem on Mac OS X:

# ~/.rvm/gems/ruby-2.1.4/extensions/x86_64-darwin-14/2.1.0-static/mysql-2.9.1/mkmf.log
find_library: checking for mysql_query() in -lmysqlclient... -------------------- no

Similar messages about the same missing function throughout mkmf.log.

I assume missing dependencies but I don't know what they would be or where this would be documented. Google doesn't seem to help. And the project is unmaintained.

Tried Ruby 2.1.4, 2.2.7, 2.4.1.

Upvotes: 1

Views: 70

Answers (1)

vcsjones
vcsjones

Reputation: 141588

You don't have the mysqlclient library installed. The easiest way to get it on your machine is to use Homebrew and do brew install mysql.

The mysql gem has native extensions - that is, when the gem is installed, native parts of it are compiled. You will need a C/C++ toolchain as well on your Mac for this to work. If you have XCode installed, you should be good to go as it provides clang.

Upvotes: 1

Related Questions