# Uninitialized constant MysqlCompat::MysqlRes

**URL:** <https://www.ruby-forum.com/t/uninitialized-constant-mysqlcompat-mysqlres/179918>\
**Category:** Ruby\
**Created:** [December 8, 2009, 3:21am UTC](https://www.ruby-forum.com/t/uninitialized-constant-mysqlcompat-mysqlres/179918 "2009-12-08T03:21:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [December 8, 2009, 3:21am UTC](https://www.ruby-forum.com/t/uninitialized-constant-mysqlcompat-mysqlres/179918/1 "2009-12-08T03:21:09Z")

</div>

I’m hoping someone can help with this. I’m baffled.

I recently upgraded to Mac OS X 10.6 (Snow Leopard).

I am now experiencing the following when I try to do any MySQL database  
operations:

uninitialized constant MysqlCompat::MysqlRes

I have Googled around on this and have tried every suggestion I’ve come  
across with no success.

Where I am now is the following:

- ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1]
- gem 1.3.5
- mysql server: mysql-5.1.41-osx10.5-x86\_64
- mysql gem: mysql (2.8.1)

I have tried every tip I have come across including the following:

sudo env ARCHFLAGS="-arch x86\_64" gem install --no-rdoc --no-ri mysql –  
–with-mysql-dir=/usr/local  
–with-mysql-config=/usr/local/mysql/bin/mysql\_config

sudo env ARCHFLAGS="-arch i386 -arch x86\_64" gem install --no-rdoc  
–no-ri mysql – --with-mysql-dir=/usr/local  
–with-mysql-config=/usr/local/mysql/bin/mysql\_config

sudo env ARCHFLAGS="-arch x86\_64" gem install mysql –  
–with-mysql-config=/usr/local/mysql/bin/mysql\_config

export ARCHFLAGS="-arch i386 -arch x86\_64" ;sudo gem install --no-rdoc  
–no-ri -v=2.7 mysql – --with-mysql-dir=/usr/local/mysql  
–with-mysql-config=/usr/local/mysql/bin/mysql\_config

And nothing has worked.

I’m wondering if anyone can provide some tips or suggestions on at least  
how to trouble shoot this problem.

Is there some way to get more detailed trace information when the mysql  
gem is loaded?  
Is there anything I can look at that I might be overlooking?

Thanks!

P.S. When I tried the suggestion of installing version 2.7 of the mysql  
gem I get this:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please  
install the mysql gem and try again: gem install mysql.  
rake aborted!  
Failed to load  
/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [December 8, 2009, 3:44am UTC](https://www.ruby-forum.com/t/uninitialized-constant-mysqlcompat-mysqlres/179918/2 "2009-12-08T03:44:24Z")

</div>

Chris C. wrote:

> I’m hoping someone can help with this. I’m baffled.
> 
> I recently upgraded to Mac OS X 10.6 (Snow Leopard).
> 
> I am now experiencing the following when I try to do any MySQL database  
> operations:
> 
> uninitialized constant MysqlCompat::MysqlRes

Dan Benjamin ([hivelogic.com](http://hivelogic.com)) has a great site for this sort of thing.  
Did you have a look at it by chance?

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

Cheers–

Charles

---

<div class="post-metadata">

**Author:** ![chriscole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/5fc32e/32.png) [@chriscole](https://www.ruby-forum.com/u/chriscole)\
**Post date:** [December 9, 2009, 3:21am UTC](https://www.ruby-forum.com/t/uninitialized-constant-mysqlcompat-mysqlres/179918/3 "2009-12-09T03:21:30Z")

</div>

On Mon, Dec 7, 2009 at 6:21 PM, Chris C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m hoping someone can help with this. I’m baffled.
> 
> I recently upgraded to Mac OS X 10.6 (Snow Leopard).

> I am now experiencing the following when I try to do any MySQL database  
> operations:
> 
> uninitialized constant MysqlCompat::MysqlRes

I got that after my disk went south, I had the replacement loaded with  
Snow Leopard, and then did a Time Machine restore.

After trying a number of suggestions, this page:

> **[Upgrading to Snow Leopard](https://rubyonrails.org/2009/8/30/upgrading-to-snow-leopard)**
>
> Last Friday, Apple released their new OS version: Snow Leopard. Upgrading to SL is very easy and even gives you back quite a lot of HD space.However a few things have changed in the OS and you need to understand what is going on so you won’t get...

:: turned out to work for me.

HTH!
