Question

I am trying to deploy my app to Heroku but I am getting the following error:

   Installing mini_portile (0.5.2)
   Installing ntlm-http (0.1.1)
   Installing webrobots (0.1.1)
   Installing naturalsorter (0.2.2)
   Using pg (0.17.0)
   Using bundler (1.5.2)
   Using raindrops (0.12.0)

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

   /tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/ruby-2.0.0/bin/ruby

extconf.rb checking for ffi.h... no checking for ffi.h in /usr/local/include,/usr/include/ffi... no 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()... no creating extconf.h creating Makefile

   make "DESTDIR="
   Configuring libffi
   /tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/bundle/ruby/2.0.0/gems/ffi-1.9.3/ext/ffi_c/libffi/configure:

line 7774: conftest.c: No such file or directory /tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/bundle/ruby/2.0.0/gems/ffi-1.9.3/ext/ffi_c/libffi/configure: line 1698: conftest.i: No such file or directory sed: can't read conftest.c: No such file or directory /tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/bundle/ruby/2.0.0/gems/ffi-1.9.3/ext/ffi_c/libffi/configure: line 7774: conftest.c: No such file or directory /tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/bundle/ruby/2.0.0/gems/ffi-1.9.3/ext/ffi_c/libffi/configure: line 1698: conftest.i: No such file or directory sed: can't read conftest.c: No such file or directory configure: error: in /tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/bundle/ruby/2.0.0/gems/ffi-1.9.3/ext/ffi_c/libffi-x86_64-linux': configure: error: C preprocessor "gcc -E" fails sanity check Seeconfig.log' for more details make: * ["/tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/bundle/ruby/2.0.0/gems/ffi-1.9.3/ext/ffi_c/libffi-x86_64-linux"/.libs/libffi_convenience.a] Error 1

   Gem files will remain installed in /tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/bundle/ruby/2.0.0/gems/ffi-1.9.3

for inspection. Results logged to /tmp/build_4fb17050-b89d-47de-afc2-a6442ad2c755/vendor/bundle/ruby/2.0.0/gems/ffi-1.9.3/ext/ffi_c/gem_make.out Installing kgio (2.9.1) Installing rdiscount (2.1.7) Installing sass (3.3.0.rc.3) An error occurred while installing ffi (1.9.3), and Bundler cannot continue. Make sure that gem install ffi -v '1.9.3' succeeds before bundling. ! ! Failed to install gems via Bundler. !

! Push rejected, failed to compile Ruby app

Any ideas what I can do?

Was it helpful?

Solution

We've ran into the same problem: How to install ffi on Heroku

We've tracked it down to Compass trying to install an incompatible executable (FFI) on Heroku, and it's not installing. What's so silly about this is that we don't need FFI to install on Heroku, considering it's only a development mode dependency.

Compass needs to bundle it's dependencies in a way that doesn't install unnecessary gems/executables on a production server (use add_development_dependency), or Heroku needs to allow it to install in the /tmp directory.

Unfortunately, we haven't solved this problem so we've reverted our code to not use the beta version of Compass and we're considering switching to Bourbon, which doesn't have unnecessary production dependencies.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top