0

I''m not a ruby guy, trying to install the knife-ec2 plugin for Chef, following the steps here

All is fine until I do

$ bundle install --path vendor

which produces the error below:

Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Installing i18n (0.6.9)
Installing multi_json (1.8.4)
Installing activesupport (3.2.16)
Installing addressable (2.3.5)
Installing builder (3.2.2)
Installing gyoku (1.1.1)
Installing mini_portile (0.5.2)
Installing nokogiri (1.6.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

        /opt/chef/embedded/bin/ruby extconf.rb
Extracting libxml2-2.8.0.tar.gz into tmp//ports/libxml2/2.8.0... OK
Running 'configure' for libxml2 2.8.0... ERROR, review 'tmp//ports/libxml2/2.8.0
/configure.log' to see what happened.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/opt/chef/embedded/bin/ruby
/home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.5.2/lib/mini_
portile.rb:265:in `block in execute': Failed to complete configure task (Runtime
Error)
        from /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.
5.2/lib/mini_portile.rb:257:in `chdir'
        from /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.
5.2/lib/mini_portile.rb:257:in `execute'
        from /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.
5.2/lib/mini_portile.rb:65:in `configure'
        from /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/mini_portile-0.
5.2/lib/mini_portile.rb:108:in `cook'
        from extconf.rb:101:in `block in <main>'
        from extconf.rb:119:in `call'
        from extconf.rb:119:in `block in <main>'
        from extconf.rb:109:in `tap'
        from extconf.rb:109:in `<main>'


Gem files will remain installed in /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.
1/gems/nokogiri-1.6.1 for inspection.
Results logged to /home/ubuntu/chef-repo/.chef/vendor/ruby/1.9.1/gems/nokogiri-1
.6.1/ext/nokogiri/gem_make.out
An error occured while installing nokogiri (1.6.1), and Bundler cannot continue.

Make sure that `gem install nokogiri -v '1.6.1'` succeeds before bundling.

Please let me know if posting additional files or console output would help.

Wayne Conrad
  • 103,207
  • 26
  • 155
  • 191
3z33etm
  • 1,083
  • 3
  • 15
  • 23
  • This is the same as: http://stackoverflow.com/questions/21700986/trying-to-install-knife-ec2 – sethvargo Feb 11 '14 at 23:40
  • I took the liberty of embedding the text you linked to. When practical, SO favors having everything needed be in the question itself. It's more convenient for the reader; also, links can go bad. – Wayne Conrad Feb 12 '14 at 13:39
  • THanks Wayne Conrad. I actually tried to do it with the 4 space indent, but it wasn't working out for me because of the other, deeper indents. Mind sharing how you did that? – 3z33etm Feb 12 '14 at 14:29
  • nm. pasted into notepad ++, hit tab once, cnp again, fixed. thx – 3z33etm Feb 12 '14 at 14:39

1 Answers1

1

You need to install libxml. The stacktrace shows you're on Ubuntu, so:

sudo apt-get install libxml2

See the Nokogiri readme for more information.

sethvargo
  • 26,739
  • 10
  • 86
  • 156
  • will give this a try. I thought the purpose of using a gemfile and bundle was to avoid dependency issues? – 3z33etm Feb 12 '14 at 01:46
  • libxml2 installs without any issues, but nokogiri still gives the exact same error. http://pastebin.com/AHv98wKk – 3z33etm Feb 12 '14 at 02:00
  • Did you install libxslt as well? http://stackoverflow.com/questions/20890808/install-nokogiri-1-6-1-under-ruby-2-0-0p353-rvm-based-installation-fails-osx – sethvargo Feb 12 '14 at 02:56
  • Yessir. sudo apt-get install libxml2-dev libxslt-dev ruby1.9.1 ruby1.9.1-dev (individually not at once) all completed with no issues. still getting a nokogiri install error. (Can't paste inline due to comment length limit) http://pastebin.com/CyfcKswM – 3z33etm Feb 12 '14 at 14:47
  • Are you using the omnibus Ruby? That Ruby is just for Chef. You need to install your own Ruby. – sethvargo Feb 12 '14 at 15:48
  • I used curl -L https://www.opscode.com/chef/install.sh | sudo bash to install Chef, I think that's the omnibus installer. So I need to install a sep ruby in order to get chef plugins to work? I'll try that. Edit: doesn't apt-get install ruby1.9.1 in my previous post address this? – 3z33etm Feb 12 '14 at 15:57