gem install berkshelf
fails with Failed to build gecode library
in Centos 6. It fails with the following output.
# /opt/chef/embedded/bin/gem install berkshelf
Building native extensions. This could take a while...
ERROR: Error installing berkshelf:
ERROR: Failed to build gem native extension.
/opt/chef/embedded/bin/ruby extconf.rb
-> sh /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.2/ext/libgecode3/vendor/gecode-3.7.3/configure --prefix=/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.2/lib/dep-selector-libgecode/vendored-gecode --disable-doc-dot --disable-doc-search --disable-doc-tagfile --disable-doc-chm --disable-doc-docset --disable-qt --disable-examples --disable-flatzinc
checking for the host operating system... Linux
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether the C++ compiler works... no
configure: error: in `/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.2/ext/libgecode3/vendor/gecode-3.7.3':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
extconf.rb:98:in `block in run': Failed to build gecode library. (GecodeBuild::BuildError)
from extconf.rb:97:in `chdir'
from extconf.rb:97:in `run'
from extconf.rb:104:in `<main>'
Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.2 for inspection.
Results logged to /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/dep-selector-libgecode-1.0.2/ext/libgecode3/gem_make.out
Installed
yum install gecode-devel -y
but still fails.Set
USE_SYSTEM_GECODE=1
.Fails this time with the following output.
Installed c++ compiler.
# yum install gcc-c++
It should now succeed.