# Problem reinstalling mysql gem

**URL:** <https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214>\
**Category:** Ruby\
**Created:** [November 25, 2006, 5:09am UTC](https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214 "2006-11-25T05:09:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 25, 2006, 5:09am UTC](https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214/1 "2006-11-25T05:09:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 25, 2006, 5:28am UTC](https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214/2 "2006-11-25T05:28:16Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 25, 2006, 5:50am UTC](https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214/3 "2006-11-25T05:50:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 25, 2006, 6:02am UTC](https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214/4 "2006-11-25T06:02:19Z")

</div>

Ahh k,

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

Cheers,  
Carl.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 25, 2006, 3:20pm UTC](https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214/5 "2006-11-25T15:20:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 25, 2006, 8:35pm UTC](https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214/6 "2006-11-25T20:35:38Z")

</div>

-----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-----

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 26, 2006, 9:15pm UTC](https://www.ruby-forum.com/t/problem-reinstalling-mysql-gem/77214/7 "2006-11-26T21:15:26Z")

</div>

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  
– removed\_email\_address@domain.invalid  
– Engine Y., Serious Rails Hosting  
– (866) 518-YARD (9273)
