# Ruby-mysql install woes

**URL:** <https://www.ruby-forum.com/t/ruby-mysql-install-woes/118475>\
**Category:** Ruby\
**Created:** [October 27, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/ruby-mysql-install-woes/118475 "2007-10-27T16:12:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [October 27, 2007, 4:12pm UTC](https://www.ruby-forum.com/t/ruby-mysql-install-woes/118475/1 "2007-10-27T16:12:15Z")

</div>

OS X 10.4.10  
ruby 1.8.4 (ruby installed using [http://rubyosx.rubyforge.org/](http://rubyosx.rubyforge.org/))

Trying to install riuby-mysql 2.7.4

Every blog & refc I can find doesn’t work.

Using gem fails. Tried all the suggestions found on blogs.

Using the native package from [tmtm.org](http://tmtm.org) fails, but I get further with it.

One tip I picked up which helps the native install to get further along  
was to add “#define ulong unsigned long” at the top of the mysql.c file  
(which does not exist with the gem install).

after I make install I get this response  
/usr/bin/install -c -m 0755 mysql.bundle  
/usr/local/lib/ruby/site\_ruby/1.8/universal-darwin8.0

then I try to do a simple two liner just to see if I get complaints

#! /usr/local/bin/ruby  
require ‘mysql’

and indeed I get this complaint:

/usr/local/lib/ruby/site\_ruby/1.8/universal-darwin8.0/mysql.bundle:  
Failed to load  
/usr/local/lib/ruby/site\_ruby/1.8/universal-darwin8.0/mysql.bundle  
(LoadError)

I’m no C geek, so I have no idea what to try next.

Ideas?

– gw

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [October 27, 2007, 4:47pm UTC](https://www.ruby-forum.com/t/ruby-mysql-install-woes/118475/2 "2007-10-27T16:47:14Z")

</div>

Greg W. wrote:

> OS X 10.4.10  
> ruby 1.8.4 (ruby installed using [http://rubyosx.rubyforge.org/](http://rubyosx.rubyforge.org/))
> 
> Trying to install riuby-mysql 2.7.4  
> Using the native package from [tmtm.org](http://tmtm.org)…  
> One tip I picked up which helps the native install to get further along  
> was to add “#define ulong unsigned long” at the top of the mysql.c file  
> after I make install I get this response  
> /usr/bin/install -c -m 0755 mysql.bundle  
> /usr/local/lib/ruby/site\_ruby/1.8/universal-darwin8.0  
> then I try to do a simple two liner just to see if I get complaints  
> #! /usr/local/bin/ruby  
> require ‘mysql’
> 
> and indeed I get this complaint:
> 
> /usr/local/lib/ruby/site\_ruby/1.8/universal-darwin8.0/mysql.bundle:  
> Failed to load  
> /usr/local/lib/ruby/site\_ruby/1.8/universal-darwin8.0/mysql.bundle  
> (LoadError)

btw the gcc I have installed is 4.01

looking closer, after make I get all this rot which maybe is meaningful  
to someone. it looked to me like it’s just recognizing that there’s no  
intel CPU, but maybe something in here is problematic?

gcc -I. -I. -I/usr/local/lib/ruby/1.8/universal-darwin8.0 -I.  
-DHAVE\_MYSQL\_H  
-I/usr/local/mysql-standard-5.0.27-osx10.4-powerpc/include -Os -arch ppc  
-fno-common -fno-common -g -O2 -fno-common -pipe -fno-common -arch  
i386 -c mysql.c

cc -dynamic -bundle -undefined suppress -flat\_namespace -arch i386  
-L"/usr/local/lib" -o mysql.bundle mysql.o -lruby  
-L/usr/local/mysql-standard-5.0.27-osx10.4-powerpc/lib -lmysqlclient -lz  
-lm -lpthread -ldl -lobjc

/usr/bin/ld: warning  
/usr/local/mysql-standard-5.0.27-osx10.4-powerpc/lib/libmysqlclient.a  
archive’s cputype (18, architecture ppc) does not match cputype (7) for  
specified -arch flag: i386 (can’t load from it)

/usr/bin/ld: warning  
/usr/lib/gcc/i686-apple-darwin8/4.0.1/…/…/…/libz.dylib cputype (18,  
architecture ppc) does not match cputype (7) for specified -arch flag:  
i386 (file not loaded)

/usr/bin/ld: warning fat file:  
/usr/lib/gcc/i686-apple-darwin8/4.0.1/…/…/…/libm.dylib does not  
contain an architecture that matches the specified -arch flag: i386  
(file ignored)

/usr/bin/ld: warning fat file:  
/usr/lib/gcc/i686-apple-darwin8/4.0.1/…/…/…/libpthread.dylib does not  
contain an architecture that matches the specified -arch flag: i386  
(file ignored)

/usr/bin/ld: warning fat file:  
/usr/lib/gcc/i686-apple-darwin8/4.0.1/…/…/…/libdl.dylib does not  
contain an architecture that matches the specified -arch flag: i386  
(file ignored)

/usr/bin/ld: warning  
/usr/lib/gcc/i686-apple-darwin8/4.0.1/…/…/…/libobjc.dylib cputype  
(18, architecture ppc) does not match cputype (7) for specified -arch  
flag: i386 (file not loaded)

/usr/bin/ld: warning fat file:  
/usr/lib/gcc/i686-apple-darwin8/4.0.1/…/…/…/libSystem.dylib does not  
contain an architecture that matches the specified -arch flag: i386  
(file ignored)

/usr/bin/ld: warning fat file: /usr/lib/libSystem.B.dylib does not  
contain an architecture that matches the specified -arch flag: i386  
(file ignored)

– gw

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [October 27, 2007, 11:10pm UTC](https://www.ruby-forum.com/t/ruby-mysql-install-woes/118475/3 "2007-10-27T23:10:43Z")

</div>

OS X 10.4.10 on Power PC machine  
ruby 1.8.4 (ruby installed using [http://rubyosx.rubyforge.org/](http://rubyosx.rubyforge.org/))

> Trying to install mysql-ruby 2.7.4  
> Using the native package from [tmtm.org](http://tmtm.org)…  
> One tip I picked up which helps the native install to get further along  
> was to add “#define ulong unsigned long” at the top of the mysql.c file

I got it to work. Applied 25 years of engineering in various fields and  
disciplines… and guessed. I’ll write up details in a while, but just  
wanted to say I managed to hack it into working.

– gw

---

<div class="post-metadata">

**Author:** ![S-gw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@S-gw](https://www.ruby-forum.com/u/S-gw)\
**Post date:** [October 28, 2007, 10:52am UTC](https://www.ruby-forum.com/t/ruby-mysql-install-woes/118475/4 "2007-10-28T10:52:36Z")

</div>

Greg W. wrote:

> OS X 10.4.10  
> ruby 1.8.6 (ruby installed using [http://rubyosx.rubyforge.org/](http://rubyosx.rubyforge.org/))
> 
> Trying to install mysql-ruby 2.7.4  
> Every blog & refc I can find doesn’t work.  
> Using gem fails. Tried all the suggestions found on blogs.  
> Using the native package from [tmtm.org](http://tmtm.org) fails, but I get further with it.

The gist of the trouble is that if you have a PowerPC Mac, the  
instructions don’t work as they assume an intel-based Mac.

I figured it out, and wrote up in detail what it took to make it work  
for me.

[http://www.railsdev.ws/blog/9/compiling-mysql-ruby-for-powerpc/](http://www.railsdev.ws/blog/9/compiling-mysql-ruby-for-powerpc/)

– gw
