簡體   English   中英

無法安裝 sqlite3 gem

[英]Cannot install sqlite3 gem

我正在嘗試運行 bundle 命令來安裝 todo 應用程序的所有 gem。 所有 gems 都下載沒有問題,但 sqlite3 gem 沒有。 我不知道以下是什么意思,有人可以解釋一下發生了什么以及如何解決嗎?

使用本機擴展安裝 sqlite3 1.3.8

Gem::Ext::BuildError: 錯誤:無法構建 gem 本機擴展。

/Users/tomfinet/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20151208-

2023-1esrcfp.rb 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()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... no
checking for sqlite3_enable_load_extension()... no
checking for sqlite3_load_extension()... no
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling backup.c
compiling database.c
compiling exception.c
compiling sqlite3.c
compiling statement.c
statement.c:261:11: warning: implicit declaration of function 'RBIGNUM' is invalid in C99 [-Wimplicit-function-declaration]
      if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {
          ^
./sqlite3_ruby.h:16:24: note: expanded from macro 'RBIGNUM_LEN'
#define RBIGNUM_LEN(x) RBIGNUM(x)->len
                       ^
statement.c:261:11: error: member reference type 'int' is not a pointer
      if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {
          ^~~~~~~~~~~~~~~~~~
./sqlite3_ruby.h:16:36: note: expanded from macro 'RBIGNUM_LEN'
#define RBIGNUM_LEN(x) RBIGNUM(x)->len
                       ~~~~~~~~~~  ^
statement.c:261:32: error: use of undeclared identifier 'SIZEOF_BDIGITS'
      if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {
                               ^
1 warning and 2 errors generated.
make: *** [statement.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/tomfinet/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.8 for inspection.
Results logged to /Users/tomfinet/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/sqlite3-1.3.8/gem_make.out
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.

有什么問題,我該如何解決? 謝謝。

bundle update sqlite3

看看這個要點

您需要針對 gem 的本機擴展的 SQLite3 開發頭文件進行編譯。 您可以通過運行(可能使用sudo )來安裝它們:

apt-get install libsqlite3-dev

之后,一定要運行

bundle update sqlite3

啊,看來是 2 月 4 日發布的 sqlite3 v1.4.0 gem 的問題。

在您的 gem 文件中提及以下 sqlite3 版本:

寶石“sqlite3”,“〜> 1.3.6”

然后確保“捆綁安裝”。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM