# Reinstall ruby's MySQL Library on OS X Server

**URL:** <https://www.ruby-forum.com/t/reinstall-rubys-mysql-library-on-os-x-server/60289>\
**Category:** Rails\
**Created:** [May 11, 2006, 9:29pm UTC](https://www.ruby-forum.com/t/reinstall-rubys-mysql-library-on-os-x-server/60289 "2006-05-11T21:29:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hon\_Bin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7c8e57/32.png) [@Hon\_Bin](https://www.ruby-forum.com/u/Hon_Bin)\
**Post date:** [May 11, 2006, 9:29pm UTC](https://www.ruby-forum.com/t/reinstall-rubys-mysql-library-on-os-x-server/60289/1 "2006-05-11T21:29:24Z")

</div>

Hello,  
I am running OS X Server version 10.4.6 and I already have some MySQL  
databases working on the server. I install the RubyGem recently,  
however, it does not work correctly with the default MySQL.

I am wondering if anybody can shed some light on:  
1): how to reinstall ruby’s mysql library on the OS X server,  
2): Is it possible to keep the old database files intact while  
reinstall ruby’s mysql library.

Thanks in advance,

-Hongbin

---

<div class="post-metadata">

**Author:** ![Hon\_Bin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7c8e57/32.png) [@Hon\_Bin](https://www.ruby-forum.com/u/Hon_Bin)\
**Post date:** [May 11, 2006, 10:28pm UTC](https://www.ruby-forum.com/t/reinstall-rubys-mysql-library-on-os-x-server/60289/2 "2006-05-11T22:28:57Z")

</div>

On May 11, 2006, at 12:26 PM, Hon Bin wrote:

> Thanks in advance,
> 
> -Hongbin

Hongbin-

```
The easiest way to install the mysql gem on OSX is as follows.

```

run this command  
$ which mysql\_config

If that returns a result then you are good to go. SO now install the  
mysql gem:

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

The extra – are important. You can safely do this without harming  
your mysql database contents.

-Ezra

---

<div class="post-metadata">

**Author:** ![Hon\_Bin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7c8e57/32.png) [@Hon\_Bin](https://www.ruby-forum.com/u/Hon_Bin)\
**Post date:** [May 11, 2006, 10:48pm UTC](https://www.ruby-forum.com/t/reinstall-rubys-mysql-library-on-os-x-server/60289/3 "2006-05-11T22:48:16Z")

</div>

Ezra,

Thank you for the tips.  
I hate to bother you with this, but when I try to fix it based upon  
what you told me, I got the following message:

$ which mysql\_config  
/usr/bin/mysql\_config  
$ sudo gem install mysql --with-mysql-config  
ERROR: While executing gem … (OptionParser::InvalidOption)  
invalid option: --with-mysql-config

Any idea?

Thanks again!  
Hongbin

---

<div class="post-metadata">

**Author:** ![Hon\_Bin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7c8e57/32.png) [@Hon\_Bin](https://www.ruby-forum.com/u/Hon_Bin)\
**Post date:** [May 12, 2006, 1:01pm UTC](https://www.ruby-forum.com/t/reinstall-rubys-mysql-library-on-os-x-server/60289/4 "2006-05-12T13:01:13Z")

</div>

Note that Ezra’s command has TWO occurrences of ‘–’, but you only  
did one. The first – tells the gem command to pass the remaining  
parameters to the command that builds the native gem.
