fabric8-services / fabric8-devdoc

http://devdoc.almighty.io/
4 stars 33 forks source link

bundle install fails because of failed attempt to install gem ffi #44

Open sbose78 opened 8 years ago

sbose78 commented 8 years ago

The bundle install fails with the following error:

[shoubhik@dhcp35-156 almighty-devdoc]$ bundle install
Fetching git://github.com/asciidoctor/jekyll-asciidoc.git
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake 10.5.0
Installing addressable 2.4.0
Installing asciidoctor 1.5.4
Installing asciidoctor-diagram 1.5.1
Installing backports 3.6.8
Installing coderay 1.1.1

Installing colorator 0.1
Installing ffi 1.9.14 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/shoubhik/.gem/ruby/gems/ffi-1.9.14/ext/ffi_c
/usr/bin/ruby -r ./siteconf20160804-660-1tk4edq.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /home/shoubhik/.gem/ruby/gems/ffi-1.9.14 for inspection.
Results logged to /home/shoubhik/.gem/ruby/extensions/x86_64-linux/2.3.0/ffi-1.9.14/gem_make.out
An error occurred while installing ffi (1.9.14), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.14'` succeeds before bundling.

gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory

As a workaround:

yum -y install gcc ruby-devel gcc-c++

This partially solves the problem. Running the 'nundle install' now gives the following error in the log: /home/shoubhik/.gem/ruby/extensions/x86_64-linux/2.3.0/ffi-1.9.14/mkmf.log

`gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory

To fix this, the following was done: dnf install redhat-rpm-config`

Now install the problematic gem manually :

`gem install ffi -v '1.9.14'

Running the bundle install works successfully now.

bartoszmajsak commented 8 years ago

One idea to improve the setup would be to provide a docker container. I did a similar one for arquillian.org. Should simplify working with the content quite a bit.