Hi all,
Whenever I try to start the cerise server and one of the applcations requires active_record, I get the following error:
dyld: /usr/local/bin/ruby can't open library: /usr/local/mysql-4.0.14/lib/mysql/libmysqlclient.12.dylib (No such file or directory, errno = 2)
Trace/BPT trap
On my windows machine everything works.
On the mac, I'm using cerise 0.7, ruby 1.8.1 compiled from the source, and mysql 4.0.20-standard downloaded from the mysql site.
Ruby and mysql run fine, Cerise starts fine if no app imports active_record, and active_record imports fine in ruby programs outside of cerise.
I'm really new to mac os x and unix (like, 3 days), so please be kind and don't assume any previous knowledge.
Also, when installing ruby, it placed itself in /usr/local/, while I'd prefer it to override the 1.6 that came with the system in /usr/. Is there a way to specify it to make install, or should i do it manually? (how?)
Thanks in advance.
* Caio Chassot <k@v2studio.com> [0746 21:46]:
Hi all,
Whenever I try to start the cerise server and one of the applcations
requires active_record, I get the following error:
dyld: /usr/local/bin/ruby can't open library:
/usr/local/mysql-4.0.14/lib/mysql/libmysqlclient.12.dylib (No such file
or directory, errno = 2)
Trace/BPT trap
What have you got in that directory, is there anything that looks like
libmysql* ?
On my windows machine everything works.
everyone always says that 
./configure --prefix=/usr
make
make install (as root or dogcow or whatever osxs equivalent is)
Dick Davies wrote:
Whenever I try to start the cerise server and one of the applcations requires active_record, I get the following error:
dyld: /usr/local/bin/ruby can't open library: /usr/local/mysql-4.0.14/lib/mysql/libmysqlclient.12.dylib (No such file or directory, errno = 2)
Trace/BPT trap
What have you got in that directory, is there anything that looks like
libmysql* ?
I don't have that directory because my mysql version is 4.0.20 (and even then, I don't have that file in my mysql dir anyway, altough I do have others that match libmysql*)
I think I've narowed down the problem to a file that comes with cerise in cerise/lib/native/powerpc-apple-darwin. called mysql.bundle, and it appears to have something to do with the dbi stuff.
The cerise README mentions something which I think is probably it:
···
---
cerise adds lib/native/<arch> to the Ruby library path so native libraries may be loaded and a single server installation can be easily moved across platforms. The <arch> value is from Config::CONFIG['host'] located in 'rbconfig'
Native drivers for some of the ruby-dbi DBDs may be included with the standard cerise bundle, however it isn't possible to build all of the native code as there are licensing and tool dependencies. If you get a DBI error saying the native library is missing, compile it according to the driver instructions and place it in the proper <arch> directory.
---
Now if I just knew how to "compile it according to the driver instructions"... any directions?
* Caio Chassot <k@v2studio.com> [0722 11:22]:
Dick Davies wrote:
>>Whenever I try to start the cerise server and one of the applcations
>>requires active_record, I get the following error:
>>
>>dyld: /usr/local/bin/ruby can't open library:
>>/usr/local/mysql-4.0.14/lib/mysql/libmysqlclient.12.dylib (No such file
>>or directory, errno = 2)
>>Trace/BPT trap
>
>
>What have you got in that directory, is there anything that looks like
>libmysql* ?
I don't have that directory because my mysql version is 4.0.20 (and even
then, I don't have that file in my mysql dir anyway, altough I do have
others that match libmysql*)
The cerise README mentions something which I think is probably it:
Native drivers for some of the ruby-dbi DBDs may be included with the
standard cerise bundle, however it isn't possible to build all of the
native code as there are licensing and tool dependencies. If you get a
DBI error saying the native library is missing, compile it according to
the driver instructions and place it in the proper <arch> directory.
Now if I just knew how to "compile it according to the driver
instructions"... any directions?
You could just try symlinking what you have under the name ruby expects:
ln -s /whereever/lib/mysql/libmysqlclient.whatever /usr/local/mysql-4.0.14/lib/mysql/libmysqlclient.12.dylib
? Might work, might segfault.
(yeah, it's a hack. but if i wanted to spend all day dicking about
with LDFLAGS and configure, I'd be a systems programmer.)
···
--
When you make your mark in the world, watch out for guys with erasers.
-- The Wall Street Journal
Rasputin :: Jack of All Trades - Master of Nuns
You could just try symlinking what you have under the name ruby expects:
ln -s /whereever/lib/mysql/libmysqlclient.whatever /usr/local/mysql-4.0.14/lib/mysql/libmysqlclient.12.dylib
? Might work, might segfault.
I think I had tried that before and it didn't work, but since then, I've ditched everything and installed mysql and ruby from darwinports, so now my mysql dir has got the .dylib files. (I have a irb with working history 
So I did as you said, more or less: I created a mysql-4.0.14 dir where cerise expected it, and inside it I created a symlink to /opt/local/lib called lib. It appears to be working (at least cerise started)
Only one other dumb question now: how do I get darwinports to install ruby in /usr? Or for that matter, mysql too? or is it advisable that I just leave port to do its stuff its own way?