Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am having an absurdly difficult time getting MySQL-Ruby to install on RedHat 4 using Ruby 1.9.2. I am behind a company proxy that prevents pretty much any package tool from connecting to external repositories so "gem install mysql" isn't going to cut it. I have tried installing the mysql-ruby gem locally but it fails with a mysterious:

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

/ns/local/apps/internal/SWS/MetricsPublisher/ruby/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
checking for main() in -lmygcc... no
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. 

I have also tried building the module myself by following the included readme. The results:

$ruby extconf.rb --with-mysql-include=/path_to_my_sql_headers/mysql/include/ --with-mysql-lib=/path_to_my_sql_lib/mysql/lib/
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
checking for main() in -lmygcc... no
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.

Does anybody have any ideas? Quite frankly, I don't even care if MySQL-Ruby specifically works, I just want ANY means of connecting to a MySQL DB through a ruby call in ruby 1.9. Thanks.

share|improve this question
    
pkg-config can't find -lmysqlclient is what it looks like –  hbdgaf Nov 9 '10 at 17:27
add comment

1 Answer

bundler usually picks the right package for me in rails...i had the same issue on a previous install of ubuntu and it seemed i needed to specify the ruby version, architecture, and mysql version as part of the gem name to get it mapped to the right versions of libraries i had. also make sure you have all the proper dependencies installed, in search path, and in ld path

share|improve this answer
    
note: I have also switched to rvm and ree now. –  hbdgaf Nov 8 '10 at 20:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.