views:

329

answers:

2
sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3 
Building native extensions.  This could take a while...
ERROR:  Error installing do_sqlite3:
    ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_open() in -lsqlite3... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

I have sqlite3-ruby installed as well as the header files, but for some reason it fails when checking for sqlite3_open()

+1  A: 

Ok, first question is why are you passing the ARCHFLAGS? That should not be necessary, if it also doesn't work without passing them, what is the output you get then?

Next question is what version of sqlite3 is it picking up? Do you have sqlite3 installed through Macports for example? Did you upgrade to Snow Leopard recently and still have an sqlite3 install from before upgrading?

Dirkjan Bussink
+1  A: 

I am having the same issue:

sudo env ARCHFLAGS="-arch x86_64" gem install do_sqlite3
Building native extensions.  This could take a while...
ERROR:  Error installing do_sqlite3:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

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

I am running Snow Leopard. I'm not sure about previous installations of sqlite3 but I did try this:

port search sqlite

And it returned the following (among others):

...
sqlite3 @3.6.17 (databases)
an embedded SQL database engine

To be honest I'm not sure what all this means. What would anyone suggest for getting do_sqlite3 installed for use in Rails 3 with DataMapper? (Also, running it without the 'env ARCHFLAGS="-arch x86_64"' gives the same errors.)

Robs