【问题标题】:Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension Linux MintGem::Installer::ExtensionBuildError: 错误: 无法构建 gem 原生扩展 Linux Mint
【发布时间】:2015-05-16 23:57:58
【问题描述】:

运行 bundle install 时出现以下错误。 在 Linux Mint 17.0 上运行 导轨 4.0.2

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/home/dubzero/.rvm/rubies/ruby-2.0.0-p643/bin/ruby extconf.rb 
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... yes
creating extconf.h
creating Makefile

make "DESTDIR="
compiling LastError.c
compiling Type.c
compiling ClosurePool.c
compiling MemoryPointer.c
compiling DataConverter.c
compiling DynamicLibrary.c
compiling FunctionInfo.c
compiling StructByReference.c
compiling Buffer.c
compiling Types.c
compiling Platform.c
compiling ffi.c
compiling Function.c
compiling Thread.c
compiling LongDouble.c
compiling Struct.c
compiling Variadic.c
compiling Call.c
Call.c: In function ‘rbffi_SetupCallParams’:
Call.c:206:28: error: ‘UINT32_ADJ’ undeclared (first use in this function)
                 ADJ(param, UINT32);
                            ^
Call.c:83:58: note: in definition of macro ‘ADJ’
 #  define ADJ(p, a) ((p) = (FFIStorage*) (((char *) p) + a##_ADJ))
                                                          ^
Call.c:206:28: note: each undeclared identifier is reported only once for each function it appears in
                 ADJ(param, UINT32);
                            ^
Call.c:83:58: note: in definition of macro ‘ADJ’
 #  define ADJ(p, a) ((p) = (FFIStorage*) (((char *) p) + a##_ADJ))
                                                          ^
Call.c:230:28: error: ‘UINT64_ADJ’ undeclared (first use in this function)
                 ADJ(param, UINT64);
                            ^
Call.c:83:58: note: in definition of macro ‘ADJ’
 #  define ADJ(p, a) ((p) = (FFIStorage*) (((char *) p) + a##_ADJ))
                                                          ^
make: *** [Call.o] Ошибка 1


Gem files will remain installed in /home/dubzero/.rvm/gems/ruby-2.0.0-p643@railstutorial_rails_4_0/gems/ffi-1.9.7 for inspection.
Results logged to /home/dubzero/.rvm/gems/ruby-2.0.0-p643@railstutorial_rails_4_0/gems/ffi-1.9.7/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.9.7), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.7'` succeeds before bundling.

宝石文件

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.2'

group :development, :test do
  gem 'sqlite3', '1.3.8'
  gem 'rspec-rails', '2.13.1'
end

group :test do
  gem 'selenium-webdriver', '2.35.1'
  gem 'capybara', '2.1.0'
end

gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end

有什么想法吗? 提前谢谢你

【问题讨论】:

  • 尝试降级ffi gem。在您的 Gemfile 中指定 gem 'ffi', '1.9.6'

标签: ruby ruby-on-rails-4 heroku rubygems bundler


【解决方案1】:

尝试使用旧版本的ffi。例如,在您的 Gemfile 中,输入:

gem 'ffi', '1.9.3'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-06
    • 2012-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-02
    • 2011-02-21
    相关资源
    最近更新 更多