问题
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 ***
回答1:
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
来源:https://stackoverflow.com/questions/21700986/trying-to-install-knife-ec2