rake install do_mysql 0.9.0 failed

113 views
Skip to first unread message

Paul Barry

unread,
Apr 28, 2008, 11:04:54 AM4/28/08
to datam...@googlegroups.com
I just tried to install the do_mysql gem on my leopard macbook with no success.  Any idea what I'm doing wrong?

~/projects/do/do_mysql $ mysql -V
mysql  Ver 14.12 Distrib 5.0.45, for apple-darwin9.2.0 (i686) using  EditLine wrapper

~/projects/do/do_mysql $ rake install
(in /Users/pbarry/projects/do/do_mysql)
Building native extensions.  This could take a while...
ERROR:  Error installing pkg/do_mysql-0.9.0:
        ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install pkg/do_mysql-0.9.0
checking for mysql.h... yes
checking for main() in -lmysqlclient... yes
checking for mysql_query()... no
checking for mysql_ssl_set()... no
creating Makefile

make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -DHAVE_MYSQL_H  -I/usr/local/mysql/include/mysql -fno-omit-frame-pointer -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -Wall   -c do_mysql_ext.c
cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup -o do_mysql_ext.bundle do_mysql.o do_mysql_ext.o rbmysql.o -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L. -arch ppc -arch i386    -lruby -lmysqlclient -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm  -lpthread -ldl -lm 
ld: duplicate symbol _ruby_type_from_mysql_type in rbmysql.o and do_mysql.o
 for architecture i386
collect2: ld returned 1 exit status
ld: warning in rbmysql.o, file is not of required architecture
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient.a, file is not of required architecture
lipo: can't open input file: /var/tmp//ccYXe7CS.out (No such file or directory)
make: *** [do_mysql_ext.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/do_mysql-0.9.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/do_mysql-0.9.0/ext/gem_make.out

Luis Lavena

unread,
Apr 28, 2008, 11:35:56 AM4/28/08
to datam...@googlegroups.com
On Mon, Apr 28, 2008 at 12:04 PM, Paul Barry <paulj...@gmail.com> wrote:
> I just tried to install the do_mysql gem on my leopard macbook with no
> success. Any idea what I'm doing wrong?
>
> ~/projects/do/do_mysql $ mysql -V
> mysql Ver 14.12 Distrib 5.0.45, for apple-darwin9.2.0 (i686) using
> EditLine wrapper
>
> ~/projects/do/do_mysql $ rake install
> (in /Users/pbarry/projects/do/do_mysql)
> Building native extensions. This could take a while...
> ERROR: Error installing pkg/do_mysql-0.9.0:
> ERROR: Failed to build gem native extension.
>
> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
> extconf.rb install pkg/do_mysql-0.9.0
> checking for mysql.h... yes
> checking for main() in -lmysqlclient... yes
> checking for mysql_query()... no
> checking for mysql_ssl_set()... no
> creating Makefile
>

From where are you grabbing the do_mysql gem?

First it looks like there's a older rbmysql.c file lying in your
checkout that is compiled too and get included also with do_mysql.c:

gcc ... do_mysql.o do_mysql_ext.o rbmysql.o

also, in ld: duplicate symbol _ruby_type_from_mysql_type in rbmysql.o
and do_mysql.o

You can try update your checkout first and try again. rbmysql.c no
longer exist in master.

HTH,
--
Luis Lavena
Multimedia systems
-
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

Martin Kihlgren

unread,
Apr 28, 2008, 11:43:15 AM4/28/08
to datam...@googlegroups.com
Actually, the do_mysql.o is probably also remains from earlier versions.

(I renamed the .c-file do_mysql_ext.c yesterday to conform to the name
of the bundle-file, which had to change for me to be able to add an
init-file and more classes to the gem.)

//Martin

Luis Lavena

unread,
Apr 28, 2008, 11:47:41 AM4/28/08
to datam...@googlegroups.com
On Mon, Apr 28, 2008 at 12:43 PM, Martin Kihlgren <zond...@gmail.com> wrote:
>
> Actually, the do_mysql.o is probably also remains from earlier versions.
>
> (I renamed the .c-file do_mysql_ext.c yesterday to conform to the name
> of the bundle-file, which had to change for me to be able to add an
> init-file and more classes to the gem.)
>

Good to know, but there is also an even older file: rbmysql.o :-P

So the only files that should be inside ext are:

.gitignore
extconf.rb
do_mysql_ext.c

Paul Barry

unread,
Apr 28, 2008, 11:52:06 AM4/28/08
to datam...@googlegroups.com
I just did this, same error:

~/projects $ rm -rf do
~/projects $ gem uninstall do_mysql
~/projects $ git clone git://github.com/sam/do.git
~/projects $ cd do/do_mysql/

Luis Lavena

unread,
Apr 28, 2008, 11:55:32 AM4/28/08
to datam...@googlegroups.com
On Mon, Apr 28, 2008 at 12:52 PM, Paul Barry <paulj...@gmail.com> wrote:
> I just did this, same error:
>
> ~/projects $ rm -rf do
> ~/projects $ gem uninstall do_mysql
> ~/projects $ git clone git://github.com/sam/do.git
> ~/projects $ cd do/do_mysql/
>
>

are you sure is the same error? can you paste again what are you
getting now from the output?

Even better, can you try "rake compile" inside do_mysql and paste the
output here?

Thank you,

Paul Barry

unread,
Apr 28, 2008, 12:07:52 PM4/28/08
to datam...@googlegroups.com
~/projects $ rm -rf do
~/projects $ gem uninstall do_mysql
ERROR:  While executing gem ... (Gem::InstallError)
    Unknown gem do_mysql->= 0

~/projects $ git clone git://github.com/sam/do.git
Initialized empty Git repository in /Users/pbarry/projects/do/.git/
remote: Generating pack...
remote: Done counting 1278 objects.
remote: Deltifying 1278 objects...
remote:  100% (1278/1278) done
remote: Total 1278 (delta 812), reused 1278 (delta 812)
Receiving objects: 100% (1278/1278), 454.67 KiB | 26 KiB/s, done.
Resolving deltas: 100% (812/812), done.
~/projects $ cd do/do_mysql/

~/projects/do/do_mysql $ rake install
(in /Users/pbarry/projects/do/do_mysql)
  Successfully built RubyGem
  Name: do_mysql
  Version: 0.9.0
  File: do_mysql-0.9.0.gem
Password:

Building native extensions.  This could take a while...
ERROR:  Error installing pkg/do_mysql-0.9.0:
        ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install pkg/do_mysql-0.9.0
checking for mysql.h... yes
checking for main() in -lmysqlclient... yes
checking for mysql_query()... no
checking for mysql_ssl_set()... no
creating Makefile

make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -DHAVE_MYSQL_H  -I/usr/local/mysql/include/mysql -fno-omit-frame-pointer -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -Wall   -c do_mysql_ext.c
cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup -o do_mysql_ext.bundle do_mysql.o do_mysql_ext.o rbmysql.o -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L. -arch ppc -arch i386    -lruby -lmysqlclient -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm  -lpthread -ldl -lm 
ld: warning in rbmysql.o, file is not of required architecture
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient.a, file is not of required architecture
ld: duplicate symbol _ruby_type_from_mysql_type in rbmysql.o and do_mysql.o
 for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cccPkgbL.out (No such file or directory)

make: *** [do_mysql_ext.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/do_mysql-0.9.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/do_mysql-0.9.0/ext/gem_make.out

Paul Barry

unread,
Apr 28, 2008, 12:08:30 PM4/28/08
to datam...@googlegroups.com
Here's rake compile:

~/projects/do/do_mysql $ rake compile
(in /Users/pbarry/projects/do/do_mysql)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb

checking for mysql.h... yes
checking for main() in -lmysqlclient... yes
checking for mysql_query()... no
checking for mysql_ssl_set()... no
creating Makefile
make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -DHAVE_MYSQL_H  -I/usr/local/mysql/include/mysql -fno-omit-frame-pointer -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -Wall   -c do_mysql_ext.c
cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup -o do_mysql_ext.bundle do_mysql_ext.o -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L. -arch ppc -arch i386    -lruby -lmysqlclient -L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm  -lpthread -ldl -lm 
ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient.a, file is not of required architecture

On Mon, Apr 28, 2008 at 11:55 AM, Luis Lavena <luisl...@gmail.com> wrote:

Luis Lavena

unread,
Apr 28, 2008, 12:13:59 PM4/28/08
to datam...@googlegroups.com

That means there are left-overs in your
/Library/Ruby/Gems/1.8/gems/do_mysql-0.9.0, even if you removed it
with gem uninstall do_mysql, there are still there (rubygems cannot
uninstall gems that don't have gemspec files under specifications,
which is the case).

Please, try rm -rf /Library/Ruby/Gems/1.8/gems/do_mysql-0.9.0 before
any other attempt

Luis Lavena

unread,
Apr 28, 2008, 12:14:57 PM4/28/08
to datam...@googlegroups.com
On Mon, Apr 28, 2008 at 1:08 PM, Paul Barry <paulj...@gmail.com> wrote:
> Here's rake compile:
>
> ~/projects/do/do_mysql $ rake compile
>
> (in /Users/pbarry/projects/do/do_mysql)
> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
> extconf.rb
> checking for mysql.h... yes
> checking for main() in -lmysqlclient... yes
> checking for mysql_query()... no
> checking for mysql_ssl_set()... no
> creating Makefile
> make
> gcc -I. -I.
> -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0
> -I. -DHAVE_MYSQL_H -I/usr/local/mysql/include/mysql -fno-omit-frame-pointer
> -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -Wall -c
> do_mysql_ext.c
> cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup -o
> do_mysql_ext.bundle do_mysql_ext.o -L"."
> -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L. -arch
> ppc -arch i386 -lruby -lmysqlclient -L/usr/local/mysql/lib/mysql
> -lmysqlclient -lz -lm -lpthread -ldl -lm
> ld: warning in /usr/local/mysql/lib/mysql/libmysqlclient.a, file is not of
> required architecture
>
>

there is no rake aborted or something like that after this? then that
means the compilation process is ok and there is some garbage in your
installation, like I pointed before.

Paul Barry

unread,
Apr 28, 2008, 12:22:43 PM4/28/08
to datam...@googlegroups.com
Bingo, that was it.  Silly me for thinking that gem uninstall do_mysql would actually delete that directory. :)  Thanks for your help.
Reply all
Reply to author
Forward
0 new messages