problem with cerise & active_record & mysql on mac os x 10.3

C

Caio Chassot

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.
 
D

Dick Davies

* Caio Chassot said:
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)
 
C

Caio Chassot

Dick said:
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.
 
D

Dick Davies

* Caio Chassot said:
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.)
 
C

Caio Chassot

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top