[chef] Re: Re: Gem packages fail on 11x on first run


Chronological Thread 
  • From: David Montgomery < >
  • To:
  • Subject: [chef] Re: Re: Gem packages fail on 11x on first run
  • Date: Mon, 4 Mar 2013 19:43:51 +0800

Yes..I just tried the below and it worked.  I have to admit .I dont understand the difference.

gem_package "knife-ec2" do
  action :install
end


On Mon, Mar 4, 2013 at 7:38 PM, Ranjib Dey < " target="_blank"> > wrote:

Looks like u are trying to install those gems in compile time, which means chef will try to install them even before installing build essential. Have you tried installing those gems in execution time? I.e without the run_action stuff. There are cases when u want to install stuff in compile time, but its not evident your example.

On Mar 4, 2013 3:14 AM, "David Montgomery" < " target="_blank"> > wrote:


I have a recipe that is the last on my run list.  I get the below error. The recipe is install first.  If I remove the recipe from the run list then after a first boot the recipe is installed.  So..as of now I have to do two runs which makes no sense.  Without out the recipe and after first boot then with the recipe.  What is soooo special about installing gem files? Why do that have to be installed first?  The same issues is with installing ec2-knife as well.

In the first recipe in the run list I have
package "build-essential" do
  action :install
end

Its also in the recipe in question.


It fails with this error.

gem_package "knife-ec2" do
  action :nothing
end.run_action(:install)

gem_package "riemann-dash" do
  action :nothing
end.run_action(:install)



ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com ================================================================================
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com Error executing action `install` on resource 'gem_package[riemann-dash]'
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com ================================================================================
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com Mixlib::ShellOut::ShellCommandFailed
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com ------------------------------------
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com Expected process to exit with [0], but received '1'
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com ---- Begin output of /opt/chef/embedded/bin/gem install riemann-dash -q --no-rdoc --no-ri -v "0.2.1" ----
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com STDOUT: Building native extensions.  This could take a while...
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com STDERR: ERROR:  Error installing riemann-dash:
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     ERROR: Failed to build gem native extension.
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com         /opt/chef/embedded/bin/ruby extconf.rb
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com checking for main() in -lssl... *** extconf.rb failed ***
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com Could not create Makefile due to some reason, probably lack of
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com necessary libraries and/or headers.  Check the mkmf.log file for more
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com details.  You may need configuration options.
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com Provided configuration options:
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-opt-dir
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-opt-include
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-opt-include=${opt-dir}/include
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-opt-lib
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-opt-lib=${opt-dir}/lib
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-make-prog
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-make-prog
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --srcdir=.
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --curdir
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --ruby=/opt/chef/embedded/bin/ruby
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-openssl-config
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-openssl-config
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-pkg-config
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-pkg-config
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-ssl-dir
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-ssl-dir
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-ssl-include
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-ssl-include=${ssl-dir}/include
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-ssl-lib
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-ssl-lib=${ssl-dir}/lib
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --with-ssllib
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com     --without-ssllib
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com /opt/chef/embedded/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
ec2-54-252-8-168.ap-southeast-2.compute.amazonaws.com You have to install development tools first.





Archive powered by MHonArc 2.6.16.

§