problems installing do_mysql

236 views
Skip to first unread message

Miguel Michelsongs

unread,
May 25, 2008, 2:34:48 PM5/25/08
to me...@googlegroups.com

Hi , im having some problems installing  the do_mysql for datamapper . i have the merb-core , merb-more and merb-plugins for 0.9.4 allready installed, also i have data_objects installed, but when i try to install the do_mysql

cd do/do_mysql
rake install

i get an error, in the mkmf.log i get an
find_library: checking for mysql_query() in -lfalse... -------------------- no

it seems it search a mysql library in the install process , im on osx using MAMP for mysql i try to use some install options for the gem when i try to install by hand, but i dont get it
is there a way to declare , in the --options, where is my mysql on the install options for this to work??

cheers



Michael Latta

unread,
May 25, 2008, 2:41:35 PM5/25/08
to me...@googlegroups.com
Did you install mysql from source, or use the OS/X install? There is
an option to declare the mysql directory (at least for the AR
adapter). do_mysql is still pretty new.

I used this in google: osx mysql gem install option do_mysql

The second entry was this: http://groups.google.com/group/datamapper/browse_thread/thread/01f26132e8dadc4f

Which seems to have some of what you are looking for.

I am on Leopard and it just worked for me with the standard mysql
install.

Michael

Luis Lavena

unread,
May 25, 2008, 3:34:52 PM5/25/08
to me...@googlegroups.com

Instead of doing rake install, do rake gem and then use rubygems functionality:

gem install pkg/do_mysql-0.9.0.gem -- --with-mysql-dir=...

you can manually also look if it will find your mysql headers:

cd ext
ruby extconf.rb

and play with the options, also the output form mkmf.log play a
important role :-)

For the record, if you installed mamp from sources outside macports
you need to check if mysql is actually in the path since mysql_config
(or mysql_config5) is used to determine where the libs and the headers
are located.

HTH,
--
Luis Lavena
AREA 17
-
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams

Miguel Michelsongs

unread,
May 25, 2008, 4:31:38 PM5/25/08
to me...@googlegroups.com
thanks !

i try
 sudo gem install --local do_mysql-0.9.0.gem  -- --with-mysql-dir=/Applications/MAMP/Library --with-mysql-include=/Applications/MAMP/Library/include

but i have the same result.

algo i try to make ir work with all the '--whitout-' options but dont work either

in mkmf.log i get this..

find_library: checking for mysql_query() in -lmysqlclient... -------------------- no

"/usr/bin/gcc-4.0 -o conftest -I. -I/opt/local/lib/ruby/1.8/i686-darwin8.11.1 -I. -I/Applications/MAMP/Library/include -I/Applications/MAMP/Library/include -I/opt/local/include -O2  -fno-common -pipe -fno-common conftest.c  -L"." -L"/opt/local/lib" -L"/Applications/MAMP/Library/lib" -L. -L/opt/local/lib     -lruby-static -lmysqlclient  -lpthread -ldl -lobjc  "
conftest.c: In function 't':
conftest.c:3: error: 'mysql_query' undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
checked program was:

... and a lot lot more ...

also i run
cd ext
ruby extconf.rb

but i get the same result

checking for mysql_query() in -lfalse... *** extconf.rb failed ***


" For the record, if you installed mamp from sources outside macports
you need to check if mysql is actually in the path since mysql_config
(or mysql_config5) is used to determine where the libs and the headers
are located."

how can i check this? mabe the error is here.
the path i would to declare is /Applications/MAMP/Library/mysql ?


also i search the
lmysqlclient but it doesnt exists

thanks



--
Atte.
Miguel Michelson Martinez
---------------------------------------
www.artenlinea.cl

Luis Lavena

unread,
May 25, 2008, 4:42:30 PM5/25/08
to me...@googlegroups.com

can you do "which mysql_config" (or is where in OSX?)

Mine is at /usr/bin/mysql_config, and there is a huge chance is named
mysql_config5 in your setup.

There is a ticket in Lighthouse about something similar:

http://wm.lighthouseapp.com/projects/4819/tickets/277-do_mysql-fails-to-compile-on-os

That was actually resolved in the #irc channel, you will require to
alter PATH so it can use the correct mysql_config utility.

>
> also i search the lmysqlclient but it doesnt exists
>

Then you need to verify if your installation of mamp includes
development headers for these packages.

I suggest you cross-post this issue to datamapper mailing list (or
better yet, jump into #datamapper on irc).

Regards,

Miguel Michelsongs

unread,
May 25, 2008, 5:18:29 PM5/25/08
to me...@googlegroups.com
Hi Luis,

it seems i dont have a mysql_config

 which mysql_config
no mysql_config in /Library/Frameworks/Python.framework/Versions/Current/bin /opt/local/bin /opt/local/sbin /bin /sbin /usr/bin /usr/sbin /Applications/MAMP/htdocs/cake_1.2.0/cake/console /bin /sbin /usr/bin /usr/sbin /usr/local/bin


mybe i have to declare it in the path?

cheers

Enrique Comba Riepenhausen

unread,
May 25, 2008, 5:22:53 PM5/25/08
to me...@googlegroups.com
On 25 May 2008, at 22:18, Miguel Michelsongs wrote:

 which mysql_config
no mysql_config in /Library/Frameworks/Python.framework/Versions/Current/bin /opt/local/bin /opt/local/sbin /bin /sbin /usr/bin /usr/sbin /Applications/MAMP/htdocs/cake_1.2.0/cake/console /bin /sbin /usr/bin /usr/sbin /usr/local/bin


mybe i have to declare it in the path?

cheers

Hi Miguel,

I have tried to run which myself and ...

ecomba$ which mysql_config

nothing there

but running 

ecomba$ which mysql_config5
/opt/local/bin/mysql_config5

There it is!

Have you tried to run the command with the 5 at the end?

Miguel Michelsongs

unread,
May 25, 2008, 5:28:58 PM5/25/08
to me...@googlegroups.com
Hi Enrique

i run which mysql_config5 but i have the same response

cheers!

Luis Lavena

unread,
May 25, 2008, 5:33:02 PM5/25/08
to me...@googlegroups.com
On Sun, May 25, 2008 at 6:28 PM, Miguel Michelsongs
<miguelm...@gmail.com> wrote:
> Hi Enrique
>
> i run which mysql_config5 but i have the same response
>

Then you are out of luck and need to find development packages for the
mamp package you installed.

We are out of luck there. Have you tried going from that custom setup
to macports? macports is developer friendly while most of the mamp out
there are plug-and-play for end-users (or ones that don't need to
compile anything).

> cheers!

Miguel Michelsongs

unread,
May 25, 2008, 6:53:17 PM5/25/08
to me...@googlegroups.com
Hi!

finnaly i get it  to work! :D



im try a #  locate mysql_config
and i get

/Applications/MAMP/Library/bin/mysql_config
/Applications/MAMP/Library/man/man1/mysql_config.1


so i think i should add this  PATH to the PATH file uhm?

vi .profile , and add the path :/Applications/MAMP/Library/bin/

then i do which mysql_config and i get the path correctly.

well, maybe that is not necesary, but it make sense to me

then in the 'manual ' of the gem i do :

 sudo gem install --local do_mysql-0.9.0.gem  -- --with-mysql-dir=/Applications/MAMP/Library  --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config

....
Building native extensions.  This could take a while...
Successfully installed do_mysql-0.9.0
1 gem installed
Installing ri documentation for do_mysql-0.9.0...
Installing RDoc documentation for do_mysql-0.9.0...


thanks for the help

Cheers!
Reply all
Reply to author
Forward
0 new messages