0

my chef-client version is 11.10.0 trying to install knife-ec2

gem install knife-ec2

ERROR: While executing gem ... (Errno::EACCES) Permission denied - /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.1/.autotest

i tried with other command:

sudo /opt/chef/embedded/bin/gem install knife-ec2
Building native extensions.  This could take a while...

ERROR: Error installing knife-ec2: ERROR: Failed to build gem native extension.

     /opt/chef/embedded/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp/x86_64-linux-gnu/ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... OK
Running 'compile' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-linux-gnu/ports/libxml2/2.8.0/compile                                                                  .log' to see what happened.
*** extconf.rb failed ***
Suresh Sala
  • 425
  • 1
  • 6
  • 17
  • You need to install the libxml binding. Please see [Installing Nokogiri on Ubuntu](http://stackoverflow.com/questions/11663499/unable-to-install-nokogiri-in-ubuntu-12-04) – sethvargo Feb 11 '14 at 17:35

1 Answers1

0

This error message tells what you missed:

Running 'compile' for libxml2 2.8.0... ERROR, review 'tmp/x86_64-linux-gnu/ports/libxml2/2.8.0/compile                                                                  .log' to see what happened.
*** extconf.rb failed ***

It tries to compile libxml2 but fails. Usually you need development library that contains header files to compile those dependencies.

Solution:

$ sudo apt-get install libxml2-dev
shawnzhu
  • 7,233
  • 4
  • 35
  • 51
  • libxslt-dev is also probably missing: `sudo apt-get install libxslt-dev libxml2-dev` and on RHEL systems: `sudo yum install libxslt-devel libxsml2-devel` – lamont Feb 16 '14 at 21:47