ubuntu - 在 Ubuntu 上安装 sqlite3 gem 时出错

标签 ubuntu sqlite

我正在尝试在 Ubuntu 上安装“捆绑安装”,但我发现 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

最佳答案

有什么原因不能从 Apt 存储库安装 sqlite3 吗?

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

关于ubuntu - 在 Ubuntu 上安装 sqlite3 gem 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8141427/

相关文章:

python - 运行 `pip install` 的 Ubuntu 给出错误 'The following required packages can not be built: * freetype'

node.js - 在 Nodemon 运行时清除终端?

java - 执行校验和时出错

sqlite - Sqlite 服务器中的 DateAdd 函数,以列名作为输入

c# - 使用 Entity Framework Core 停止在 Sqlite 内存 DB 中自动加载相关实体

iphone - 来自 SQLite 的 bool 值总是返回 0

linux - 启用目录浏览 apache2 - Ubuntu

node.js - 使用 Cron 制作 Forever.js Reboot-Proof

python - 如何创建只有一个帖子的页面?

python - 组合框中的 map 数据与超过 256 个项目相关