在Ubuntu上安装sqlite3 gem时出错

时间:2011-11-15 18:45:24

标签: ubuntu sqlite

我正在尝试在Ubuntu上安装“bundle install”,我得到 sqlite3 -v'1.3.4'缺少。 当我尝试gem install sqlite3 -v '1.3.4'时,我得到了以下内容

ERROR: (I have installed libsqli3-dev and sqlite3-ruby - didn't help)

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

       /home/jars/.rvm/rubies/ruby-1.9.2-p290/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()... yes
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
creating Makefile

make
gcc -I. -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/i686-linux -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -DHAVE_RB_PROC_ARITY -DHAVE_SQLITE3_COLUMN_DATABASE_NAME -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQLITE3_LOAD_EXTENSION  -D_FILE_OFFSET_BITS=64  -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -fPIC  -o backup.o -c backup.c
gcc -I. -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/i686-linux -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -DHAVE_RB_PROC_ARITY -DHAVE_SQLITE3_COLUMN_DATABASE_NAME -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQLITE3_LOAD_EXTENSION  -D_FILE_OFFSET_BITS=64  -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -fPIC  -o exception.o -c exception.c
gcc -I. -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/i686-linux -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1/ruby/backward -I/home/jars/.rvm/rubies/ruby-1.9.2-p290/include/ruby-1.9.1 -I. -DHAVE_RB_PROC_ARITY -DHAVE_SQLITE3_COLUMN_DATABASE_NAME -DHAVE_SQLITE3_ENABLE_LOAD_EXTENSION -DHAVE_SQLITE3_LOAD_EXTENSION  -D_FILE_OFFSET_BITS=64  -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long  -fPIC  -o database.o -c 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:72: error: ‘SQLITE_OPEN_READONLY’ undeclared (first use in this function)
database.c: In function ‘set_sqlite3_func_result’:
database.c:278: error: ‘sqlite3_int64’ undeclared (first use in this function)
make: *** [database.o] Error 1


Gem files will remain installed in /home/jars/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4 for inspection.
Results logged to /home/jars/.rvm/gems/ruby-1.9.2-p290/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out

1 个答案:

答案 0 :(得分:1)

是否有理由无法从Apt存储库安装sqlite3

$ apt-cache show sqlite3
Package: sqlite3
Priority: optional
...
Version: 3.7.7-2ubuntu2