Today I tried to install knife vsphere support for Chef (You can make it by this command $gem install knife-vsphere ) on Ubuntu and received several errors.
First of them was:
Building native extensions. This could take a while…
ERROR: Error installing knife-vsphere:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/libyajl2-1.2.0 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/libyajl2-1.2.0/gem_make.out
vovando@dcl-ubuntu-test:~$ cat /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/libyajl2-1.2.0/gem_make.out
/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
Solution: $ sudo apt-get install ruby-dev
The second try to install:
Building native extensions. This could take a while…
ERROR: Error installing knife-vsphere:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
checking if the C compiler accepts … yes
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz… no
zlib is missing; necessary for building libxml2
*** 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.
Solution:
$ sudo apt-get install zlib1g-dev
After that everything was fine:
vovando@dcl-ubuntu-test:~$ sudo gem install knife-vsphere
Building native extensions. This could take a while…
Successfully installed nokogiri-1.6.6.2
Fetching: rbvmomi-1.8.2.gem (100%)
Successfully installed rbvmomi-1.8.2
Fetching: gyoku-1.3.1.gem (100%)
Successfully installed gyoku-1.3.1
Fetching: nori-2.6.0.gem (100%)
Successfully installed nori-2.6.0
Fetching: little-plugger-1.1.3.gem (100%)
Successfully installed little-plugger-1.1.3
Fetching: logging-1.8.2.gem (100%)
Successfully installed logging-1.8.2
Fetching: rubyntlm-0.4.0.gem (100%)
Successfully installed rubyntlm-0.4.0
Fetching: httpclient-2.6.0.1.gem (100%)
Successfully installed httpclient-2.6.0.1
Fetching: gssapi-1.2.0.gem (100%)
Successfully installed gssapi-1.2.0
Fetching: winrm-1.3.3.gem (100%)
Successfully installed winrm-1.3.3
Fetching: winrm-s-0.3.1.gem (100%)
Successfully installed winrm-s-0.3.1
Fetching: knife-windows-1.0.0.rc.1.gem (100%)
Successfully installed knife-windows-1.0.0.rc.1
Fetching: knife-vsphere-1.2.3.gem (100%)
Successfully installed knife-vsphere-1.2.3
Parsing documentation for gssapi-1.2.0
Installing ri documentation for gssapi-1.2.0
Parsing documentation for gyoku-1.3.1
Installing ri documentation for gyoku-1.3.1
Parsing documentation for httpclient-2.6.0.1
Installing ri documentation for httpclient-2.6.0.1
Parsing documentation for knife-vsphere-1.2.3
Installing ri documentation for knife-vsphere-1.2.3
Parsing documentation for knife-windows-1.0.0.rc.1
Installing ri documentation for knife-windows-1.0.0.rc.1
Parsing documentation for little-plugger-1.1.3
Installing ri documentation for little-plugger-1.1.3
Parsing documentation for logging-1.8.2
Installing ri documentation for logging-1.8.2
Parsing documentation for nokogiri-1.6.6.2
Installing ri documentation for nokogiri-1.6.6.2
Parsing documentation for nori-2.6.0
Installing ri documentation for nori-2.6.0
Parsing documentation for rbvmomi-1.8.2
Installing ri documentation for rbvmomi-1.8.2
Parsing documentation for rubyntlm-0.4.0
Installing ri documentation for rubyntlm-0.4.0
Parsing documentation for winrm-1.3.3
Installing ri documentation for winrm-1.3.3
Parsing documentation for winrm-s-0.3.1
Installing ri documentation for winrm-s-0.3.1
Done installing documentation for gssapi, gyoku, httpclient, knife-vsphere, knife-windows, little-plugger, logging, nokogiri, nori, rbvmomi, rubyntlm, winrm, winrm-s after 13 seconds
13 gems installed
Stay tuned!
Leave a Reply