# Mysql gem: better native extension error than this?

**URL:** <https://www.ruby-forum.com/t/mysql-gem-better-native-extension-error-than-this/182866>\
**Category:** Ruby\
**Created:** [February 4, 2010, 1:40am UTC](https://www.ruby-forum.com/t/mysql-gem-better-native-extension-error-than-this/182866 "2010-02-04T01:40:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [February 4, 2010, 1:40am UTC](https://www.ruby-forum.com/t/mysql-gem-better-native-extension-error-than-this/182866/1 "2010-02-04T01:40:24Z")

</div>

uninitialized constant MysqlCompat::MysqlRes

…surely the error can be better than this. The meaning of this error  
is  
“the native extension failed to load”, however the error does not convey  
this whatsoever. Can’t this be:

NativeExtensionError: couldn’t load libmysqlclient.so

Or something slightly more informative?

---

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [February 4, 2010, 1:50pm UTC](https://www.ruby-forum.com/t/mysql-gem-better-native-extension-error-than-this/182866/2 "2010-02-04T13:50:53Z")

</div>

On Feb 4, 1:38 am, Tony A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Or something slightly more informative?

When are you getting this?

A sample script that can reproduce it? Or is a Rails application?

Definitely things could be better, also world peace can be achieved if  
humans weren’t so greedy and help each other instead.

The repository used to build the gem is 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

Feel free to fork it, adjust what is needed and ensure tests works  
prior sending a pull request.

Regards,

---

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [February 4, 2010, 6:08pm UTC](https://www.ruby-forum.com/t/mysql-gem-better-native-extension-error-than-this/182866/3 "2010-02-04T18:08:29Z")

</div>

On Thu, Feb 4, 2010 at 5:44 AM, Luis L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> When are you getting this?

Installing the mysql gem, under Snow Leopard unless ARCHFLAGS=-arch  
x86\_64  
is set.

The repository used to build the gem is here:

> [GitHub - luislavena/mysql-gem: MySQL/Ruby Bindings, wrapped as Gem with improved cross-platform support](http://github.com/luislavena/mysql-gem)
> 
> Feel free to fork it, adjust what is needed and ensure tests works  
> prior sending a pull request.

Ok

---

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [February 5, 2010, 1:04am UTC](https://www.ruby-forum.com/t/mysql-gem-better-native-extension-error-than-this/182866/4 "2010-02-05T01:04:49Z")

</div>

On Feb 4, 6:07 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.]
> 
> On Thu, Feb 4, 2010 at 5:44 AM, Luis L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > When are you getting this?
> 
> Installing the mysql gem, under Snow Leopard unless ARCHFLAGS=-arch x86\_64  
> is set.

The offending code is here:

> <https://github.com/luislavena/mysql-gem/blob/master/ext/mysql_api/extconf.rb#L1-8>

Since I haven’t upgraded my Leopard installation to Slow Leopard, I  
cannot test all these details.

I’ve that _cough_ feature _cough_ from DataObjects, which got removed  
after SL release.

Since I don’t have a spare Mac for work, couldn’t afford the time will  
take to rebuild my whole environment due the craziness of mixed 64/32  
bits applications and libraries.

If you take a look to current DataObjects, maybe you can bring these  
changes in:

> <https://github.com/datamapper/do/blob/master/do_mysql/ext/do_mysql/extconf.rb>
