问题为DataMapper安装do_sqlite3

时间:2009-12-25 17:56:03

标签: ruby macos rubygems sqlite datamapper

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.

我安装了sqlite3-ruby以及头文件,但由于某些原因它在检查sqlite3_open()时失败了

2 个答案:

答案 0 :(得分:1)

好的,第一个问题是你为什么要通过ARCHFLAGS?这不应该是必要的,如果它没有通过它也不起作用,你得到的输出是什么?

接下来的问题是sqlite3的版本是什么?你有通过Macports安装sqlite3吗?您最近是否升级到Snow Leopard并且在升级之前仍然安装了sqlite3?

答案 1 :(得分:1)

我遇到同样的问题:

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

我正在运行Snow Leopard。我不确定之前安装的sqlite3,但我确实试过这个:

port search sqlite

它返回以下(等等):

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

说实话,我不确定这一切意味着什么。有人建议安装do_sqlite3以便在Rails 3中使用DataMapper吗? (另外,没有'env ARCHFLAGS =“ - arch x86_64”'运行它会产生相同的错误。)