Problem reinstalling mysql gem

I had to reload my system and am trying to bring up ruby on my kubuntu
system. I’ve compiled / installed ruby and rubygems. I then run
sudo gem install mysql -y

I select 2 when it asks for mysql 2.7 (ruby). It then runs a bit, then I
get the following errors:

 ERROR: Failed to build gem native extension.
 Gem files will remain installed in
    /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.

 Results logged to 

/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out

I have no idea what to look at other than the file that supposedly it
was logged to, but the “gem_make.out” file has absolutely nothing in it
(actually, it has 1 byte, but I think it’s a space)

Can anyone offer any help.
As always, thanks in advance.
—Michael

Hi Michael,

If you are running on osx you probably have the compile problem listed
on this site:

http://www.railtie.net/articles/2006/09/12/running-rails-on-os-x-with-mysql-5-0-24

Once you add the #define ulong unsigned long as one of the top lines
of mysql.c in the gem, you can just do:

  • sudo ruby extconf.rb
  • sudo make
  • sudo make install

Let me know if this helps?

Cheers,
Carl.

Carl W. wrote:

Hi Michael,

If you are running on osx you probably have the compile problem listed
on this site:

Good try, but I’m running Kubuntu Linux.

Ahh k,

not sure then, you will need to get the error out or you can use apt
to install it?

Cheers,
Carl.

Carl W. wrote:

Ahh k,

not sure then, you will need to get the error out or you can use apt
to install it?

Getting the error out seems to be a problem. It tells me where it has
logged it, but it didn’t put anything in that file.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael S. wrote:

Carl W. wrote:

Ahh k,

not sure then, you will need to get the error out or you can use apt
to install it?

Getting the error out seems to be a problem. It tells me where it has
logged it, but it didn’t put anything in that file.

Try to install the Ubuntu-Mysql development packages. I guess it is
libmysqlclient12-dev, but I’m not sure about this.

If gem_make.out is empty you can have a look into mkmf.log (same
directory).

Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFFaJrL9S2Eui6zfdQRAtGlAJ0Un51HeS5yCQhnAg1uNye0Vh65EACgraIB
2a09b1o5XuAiZDUtjSMyKU8=
=de8O
-----END PGP SIGNATURE-----

On Nov 24, 2006, at 8:10 PM, Michael S. wrote:

    /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.

As always, thanks in advance.
—Michael

Hey Michael-

Run this command:

$ which mysql_config

If that returns a path to mysql_config then you can install the

mysql gem with this command:

$ sudo gem install mysql – --with-mysql-config

If you don't have mysql_config in your path then you may be better

off trying to install the .deb package for libmysql-ruby from apt.

Cheers-

– Ezra Z.
– Lead Rails Evangelist
[email protected]
– Engine Y., Serious Rails Hosting
– (866) 518-YARD (9273)