Caused by: Gem::MissingSpecError: Could not find 'ffi' (>= 1.0.0) among 241 total gem(s)

Viewed 26

I'm trying to build a docker image on CircleCI, that uses linux.

Installing llhttp-ffi 0.4.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /usr/src/gems/ruby/2.7.0/gems/llhttp-ffi-0.4.0/ext
/usr/local/bin/ruby -I/usr/local/lib/ruby/2.7.0/rubygems -rrubygems
/usr/src/gems/ruby/2.7.0/gems/rake-13.0.6/exe/rake
RUBYARCHDIR\=/usr/src/gems/ruby/2.7.0/extensions/x86_64-linux/2.7.0/llhttp-ffi-0.4.0
RUBYLIBDIR\=/usr/src/gems/ruby/2.7.0/extensions/x86_64-linux/2.7.0/llhttp-ffi-0.4.0
rake aborted!
Gem::MissingSpecError: Could not find 'ffi' (>= 1.0.0) among 241 total gem(s)
Checked in 'GEM_PATH=/usr/src/gems/ruby/2.7.0', execute `gem env` for more
information
/usr/src/gems/ruby/2.7.0/gems/llhttp-ffi-0.4.0/ext/Rakefile:3:in `<top
(required)>'
/usr/src/gems/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<main>'

Caused by:
Gem::MissingSpecError: Could not find 'ffi' (>= 1.0.0) among 241 total gem(s)
Checked in 'GEM_PATH=/usr/src/gems/ruby/2.7.0', execute `gem env` for more
information
/usr/src/gems/ruby/2.7.0/gems/llhttp-ffi-0.4.0/ext/Rakefile:3:in `<top
(required)>'
/usr/src/gems/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<main>'

Caused by:
LoadError: cannot load such file -- ffi-compiler/compile_task
/usr/src/gems/ruby/2.7.0/gems/llhttp-ffi-0.4.0/ext/Rakefile:3:in `<top
(required)>'
/usr/src/gems/ruby/2.7.0/gems/rake-13.0.6/exe/rake:27:in `<main>'
(See full trace by running task with --trace)

rake failed, exit code 1

Gem files will remain installed in
/usr/src/gems/ruby/2.7.0/gems/llhttp-ffi-0.4.0 for inspection.
Results logged to
/usr/src/gems/ruby/2.7.0/extensions/x86_64-linux/2.7.0/llhttp-ffi-0.4.0/gem_make.out

An error occurred while installing llhttp-ffi (0.4.0), and Bundler cannot
continue.
Make sure that `gem install llhttp-ffi -v '0.4.0' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  http was resolved to 5.1.0, which depends on
    llhttp-ffi
The command '/bin/sh -c bundle install' returned a non-zero code: 5

My gem file includes ffi

My Dockerfile runs this command

  && apt-get install -y \
    build-essential \
    libpq-dev \
    postgresql \
    nodejs \
    cmake \
    libffi-dev \
    libtool \
    libjpeg-dev \ 
    libpng-dev \ 
    libtiff-dev \ 
    libwebp-dev \
  && apt-get clean autoclean \
  && apt-get autoremove -y```

Am I missing any dependency in the Dockerfile?
1 Answers

Based on rakelib/ffi_gem_helper.rb. Try add libltdl-dev.

Related