在编译 bundle install
时,我得到了这个错误:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/bartsabayton/.rvm/rubies/ruby-2.2.0-preview1/bin/ruby -r ./siteconf20150310-8631-16gdgvg.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()... yes
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
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 statement.c
statement.c: In function ‘bind_param’:
statement.c:261:7: warning: implicit declaration of function ‘RBIGNUM’ [-Wimplicit-function-declaration]
statement.c:261:11: error: invalid type argument of ‘->’ (have ‘int’)
statement.c:261:32: error: ‘SIZEOF_BDIGITS’ undeclared (first use in this function)
statement.c:261:32: note: each undeclared identifier is reported only once for each function it appears in
statement.c: In function ‘reset_bang’:
statement.c:293:7: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
statement.c: In function ‘clear_bindings’:
statement.c:313:7: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
make: *** [statement.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/bartsabayton/.rvm/gems/ruby-2.2.0-preview1@e-law-landing/gems/sqlite3-1.3.8 for inspection.
Results logged to /home/bartsabayton/.rvm/gems/ruby-2.2.0-preview1@e-law-landing/extensions/x86-linux/2.2.0/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.
所以我做了 gem install sqlite3 -v '1.3.8'
,但是这样做的时候,
ERROR: While executing gem ... (ArgumentError)
IPv4 address expects 4 bytes but 1 bytes
我检查了我的 rvm,
RVM 列表:
bartsabayton@bartsabayton-All-Series:~/rails/landing$ rvm list
rvm rubies
ruby-2.0.0-p0 [ i686 ]
ruby-2.1.0 [ i686 ]
* ruby-2.1.3 [ i686 ]
=> ruby-2.2.0-preview1 [ i686 ]
# => - current
# =* - current && default
# * - default
我正在使用:
- Ubuntu 12.04
- Ruby 2.2.0preview1(2014-09-17 主干 47616)[i686-linux]
请帮忙。需要修复它。
您使用的是 Ruby 2.2.0,而这个特定版本的 sqlite3 (1.3.8) 不适用于它。
因此,您应该安装更新版本的 sqlite3。
你可以试试:
gem install sqlite3
并确保您在系统上安装了 sqlite3
和 sqlite-devel
。
注意:正如 Ismael 注意到的,您还应该更新 Ruby。
我是一名优秀的程序员,十分优秀!