Gem::Ext::BuildError 尝试在 rails 应用中安装 gem bootstrap-sass

Gem::Ext::BuildError while trying to install gem bootstrap-sass in rails app

好的,所以我正在尝试在我的 ruby on rails 应用程序中安装 gem bootstrap-sass 但是越来越这个错误。

我按照基本步骤将 $ gem 'bootstrap-sass'$ gem 'autoprefixer-rails' 粘贴到 gem 文件中,然后在终端中运行 nig bndle install。我的笔记本电脑 运行 ubuntu 18.04 如果这可能会导致问题。

Installing autoprefixer-rails 9.6.1
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Fetching ffi 1.11.1
Installing ffi 1.11.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/tmp/bundler20190706-4690-hktydzffi-1.11.1/gems/ffi-1.11.1/ext/ffi_c
/usr/bin/ruby2.5 -r ./siteconf20190706-4690-tr7q8y.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/tmp/bundler20190706-4690-hktydzffi-1.11.1/gems/ffi-1.11.1 for inspection.
Results logged to
/tmp/bundler20190706-4690-hktydzffi-1.11.1/extensions/x86_64-linux/2.5.0/ffi-1.11.1/gem_make.out

An error occurred while installing ffi (1.11.1), and Bundler cannot
continue.
Make sure that `gem install ffi -v '1.11.1'` succeeds before bundling.

In Gemfile:
  bootstrap-sass was resolved to 3.4.1, which depends on
    sassc was resolved to 2.0.1, which depends on
      ffi

gem 'bootstrap-sass', '3.3.7'

排斥

gem 'bootstrap-sass'.

因为 bootstrap-sass 3.4.1 太高了。