1

我正在尝试在 Rails 上安装用于 ruby​​ 的 sqlite3 gem 并收到此错误...我已经通过 yum 成功安装了 sqlite3。

Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3:
    ERROR: Failed to build gem native extension.

        /usr/local/rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for sqlite3_initialize()... no
checking for sqlite3_backup_init()... no
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
creating Makefile

make
compiling database.c
database.c: In function ‘initialize’:
database.c:47: error: ‘SQLITE_OPEN_READWRITE’ undeclared (first use in this function)
database.c:47: error: (Each undeclared identifier is reported only once
database.c:47: error: for each function it appears in.)
database.c:47: error: ‘SQLITE_OPEN_CREATE’ undeclared (first use in this function)
database.c:79: error: ‘SQLITE_OPEN_READONLY’ undeclared (first use in this function)
database.c:81: warning: implicit declaration of function ‘sqlite3_open_v2’
database.c: In function ‘set_sqlite3_func_result’:
database.c:285: error: ‘sqlite3_int64’ undeclared (first use in this function)
database.c:285: error: expected expression before ‘long’
database.c: In function ‘collation’:
database.c:628: warning: implicit declaration of function ‘sqlite3_create_collation_v2’
database.c: In function ‘load_extension’:
database.c:657: warning: implicit declaration of function ‘sqlite3_load_extension’
database.c: In function ‘enable_load_extension’:
database.c:678: warning: implicit declaration of function ‘sqlite3_enable_load_extension’
make: *** [database.o] Error 1


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/sqlite3-1.3.5 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p125@rails3tutorial2ndEd/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out
4

1 回答 1

0

较早的指南显示了如何安装 sqlite 和所有开发包,以及其他一些技巧。看起来你只是在玩教程,但如果你要开发,我建议安装一个“真正的”数据库。一个具有更多功能,什么不是。MySQL 或 PostgreSQL。

还要确保您也通过 64 位操作系统安装它,因为它看起来需要从该错误堆栈中获取它,或者正在寻找它。

于 2012-04-04T02:05:34.673 回答