jonderry
jonderry

Reputation: 23633

Can't run install MySQL gem Fedora 14, even after installing mysql-devel, ruby-devel, and rubygems

I'm trying to install the mysql gem via

sudo gem install mysql --version 2.7

However, I get the following error:

Building native extensions.  This could take a while...
...........
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Any ideas?

Upvotes: 1

Views: 605

Answers (1)

Kalendae
Kalendae

Reputation: 2244

somethings to try:

gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

of course use path of where your mysql_config is. mysql_config will be there if you've installed a mysql client

gem install mysql -- \
--with-mysql-include=/usr/include/mysql \
--with-mysql-lib=/usr/lib/mysql

use paths of where your lib and headers are for mysql.

Upvotes: 2

Related Questions