Topic: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

I am trying to install the MySQL driver on my (gs) account at Media Temple and have followed each step at http://kb.mediatemple.net/article.php?id=140. I had it working then my app kept coming up with a proxy error after running for about 10 minutes so I tried reinstalling everything. Now whenever I run "gem install mysql --source=http://gems.mediatemple.net/" it comes up with the following error.

Can someone tell me how to fix this? I have been pulling my hair out for over an hour with this.

DOMAIN.com@cl26:/home/XXXX/data$ gem install mysql --source=http://gems.mediatemple.net/
Bulk updating Gem source index for: http://gems.mediatemple.net/
Select which gem to install for your platform (i386-linux)
1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (i386-linux)
4. mysql 2.7 (ruby)
5. Skip this gem
6. Cancel installation
> 4
Building native extensions.  This could take a while...
ERROR:  While executing gem ... (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

ruby extconf.rb install mysql - --source=http://gems.mediatemple.net/
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
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... 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.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-mysql-config
        --without-mysql-config
        --with-mysql-dir
        --without-mysql-dir
        --with-mysql-include
        --without-mysql-include=${mysql-dir}/include
        --with-mysql-lib
        --without-mysql-lib=${mysql-dir}/lib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-mlib
        --without-mlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-zlib
        --without-zlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-socketlib
        --without-socketlib
        --with-mysqlclientlib
        --without-mysqlclientlib
        --with-nsllib
        --without-nsllib
        --with-mysqlclientlib
        --without-mysqlclientlib


Gem files will remain installed in /home/XXXX/data/rubygems/gems/gems/mysql-2.7 for inspection.
Results logged to /home/XXXX/data/rubygems/gems/gems/mysql-2.7/gem_make.out


Any help would be greatly appreciated.

Last edited by freaky (2007-05-27 18:31:50)

Re: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

You are missing the gcc.
First install the gcc, then try the gem installation again.

Thanks!

--
sur
http://expressica.com

Re: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

Download the gcc RPM  here http://expressica.com/downloads/rpms/gcc and install it as rpm -i gcc3.3.....rpm

Re: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

I ended up getting it to work by installing the i-386 linux version. Would it make a difference or not if I installed it with this option or the ruby one?

Re: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

Freaky,

I am getting the same error installing it on FC6 (x86_64), how did you install the i-386 version? I am using gcc 4.1.1 but it is the x86_64 version according to yum.

Also, does anyone know how to verify if the install work correctly and that the low-level C binding is in effect?

Thanks,
Bob

JiggyMe
"Videos that Matter to You" powered by Ruby on Rails

Re: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

I just entered #3 instead of #4 and it worked for me.

Re: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

Shoot, I don't have a i386 option 3 listed, my (3) is mysql 2.7(ruby) and (4) is mysql 2.6(ruby).  If anyone else has any other idea please let me know, I am  pretty stuck.

JiggyMe
"Videos that Matter to You" powered by Ruby on Rails

Re: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

SUCCESS FINALLY!!!

here's the command that did the trick for FC6,
sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

Notice the 2 sets of -- in a row, if you don't do that, it will complain with-mysql-config as invalid option. This wasted 3 days of my freaking time but now I can move on with my life.

JiggyMe
"Videos that Matter to You" powered by Ruby on Rails

Re: ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)

I fixed this problem installing the "libmysqlclient15-dev" package:

sudo apt-get install libmysqlclient15-dev

I'm using Ubuntu Feisty.