# Feezing mysql gem + unitiliazed constant MysqlCompat::Mysql

**URL:** <https://www.ruby-forum.com/t/feezing-mysql-gem-unitiliazed-constant-mysqlcompat-mysql/180199>\
**Category:** Ruby\
**Created:** [December 14, 2009, 3:38pm UTC](https://www.ruby-forum.com/t/feezing-mysql-gem-unitiliazed-constant-mysqlcompat-mysql/180199 "2009-12-14T15:38:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![renatojf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@renatojf](https://www.ruby-forum.com/u/renatojf)\
**Post date:** [December 14, 2009, 3:38pm UTC](https://www.ruby-forum.com/t/feezing-mysql-gem-unitiliazed-constant-mysqlcompat-mysql/180199/1 "2009-12-14T15:38:11Z")

</div>

I need to freeze the mysql gem inside my app, since it’s no longer  
bundled with rails.

So, I installed the mysql 2.8.1 gem and got that “uninitialized constant  
MysqlCompat::MysqlRes” error when I’m trying to deploy my app (occurring  
on the first rake command).

Googling about it, I’ve found out that it’s a gem problem so I’d need to  
symlink things directly or specify some ARCHFLAGS.

Problem is both solutions didn’t worked. Can anyone help me with this?

---

<div class="post-metadata">

**Author:** ![renatojf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@renatojf](https://www.ruby-forum.com/u/renatojf)\
**Post date:** [December 14, 2009, 7:14pm UTC](https://www.ruby-forum.com/t/feezing-mysql-gem-unitiliazed-constant-mysqlcompat-mysql/180199/2 "2009-12-14T19:14:16Z")

</div>

AFAICT the mysql gem has been and continues to be broken in some manner.

Downgrading the mysql gem to 2.7 whenever I encounter this problem has  
shown  
itself to be a consistent fix and I really have no idea why.

At the very least, whatever is causing this error could certainly  
warrant  
some better feedback than the arcane “uninitialized constant  
MysqlCompat::MysqlRes”

---

<div class="post-metadata">

**Author:** ![renatojf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@renatojf](https://www.ruby-forum.com/u/renatojf)\
**Post date:** [December 14, 2009, 9:25pm UTC](https://www.ruby-forum.com/t/feezing-mysql-gem-unitiliazed-constant-mysqlcompat-mysql/180199/3 "2009-12-14T21:25:16Z")

</div>

Downgrading the mysql gem to 2.7 didn’t work either on rails 2.3.5  
The solution I found was that my host machine didn’t had libmysql-ruby  
installed. So I had to manually install it and then my deploy went fine.

---

<div class="post-metadata">

**Author:** ![renatojf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9fc348/32.png) [@renatojf](https://www.ruby-forum.com/u/renatojf)\
**Post date:** [December 15, 2009, 1:16am UTC](https://www.ruby-forum.com/t/feezing-mysql-gem-unitiliazed-constant-mysqlcompat-mysql/180199/4 "2009-12-15T01:16:00Z")

</div>

On Dec 14, 3:13 pm, Tony A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [Note: parts of this message were removed to make it a legal post.]
> 
> AFAICT the mysql gem has been and continues to be broken in some manner.

The gem is a wrapper arount MySQL/Ruby bindings from tmtm:

[http://rubyforge.org/projects/mysql-ruby](http://rubyforge.org/projects/mysql-ruby)

If there is a problem with the extension, like a broken API between  
versions, please report it there.

On a new release of the extension I’ll wrap it and package in the  
mysql gem, here:

> **[GitHub - luislavena/mysql-gem: MySQL/Ruby Bindings, wrapped as Gem with...](https://github.com/luislavena/mysql-gem)**
>
> MySQL/Ruby Bindings, wrapped as Gem with improved cross-platform support - GitHub - luislavena/mysql-gem: MySQL/Ruby Bindings, wrapped as Gem with improved cross-platform support
