Skip to content

Instantly share code, notes, and snippets.

@FaKleiser
Last active October 9, 2018 07:50
Show Gist options
  • Save FaKleiser/c0ea09b597e53b31122bb7866a57a629 to your computer and use it in GitHub Desktop.
Save FaKleiser/c0ea09b597e53b31122bb7866a57a629 to your computer and use it in GitHub Desktop.
BOSH install fails with nokogiri

Error Description

Installing a BOSH director with bosh create-env with the vSphere CPI release fails during the compilation of the vSphere package with the bosh-create-env.log. This happens on Ubuntu 16.04 / 18.04 with or without system Rubys (2.3 / 2.4 / 2.5) installed.

Resolution

Notice that about in the middle of the log it says:

`require': cannot load such file -- openssl (LoadError)

So simply install openssl to resolve the issue:

apt-get install openssl ruby-openssl libssl-dev
Deployment manifest: '/cf-automation/bosh/resources/bosh-deployment/bosh.yml'
Deployment state: 'environment/state.json'
Started validating
Validating release 'bosh'... Finished (00:00:03)
Validating release 'bosh-vsphere-cpi'... Finished (00:00:00)
Validating release 'uaa'... Finished (00:00:19)
Validating release 'credhub'... Finished (00:00:05)
Validating release 'syslog'... Finished (00:00:02)
Validating cpi release... Finished (00:00:00)
Validating deployment manifest... Finished (00:00:00)
Validating stemcell... Finished (00:00:06)
Finished validating (00:00:39)
Started installing CPI
Compiling package 'ruby-2.4-r4/0cdc60ed7fdb326e605479e9275346200af30a25'... Finished (00:00:00)
Compiling package 'vsphere_cpi/51c403f3cf6ab778ed8cea263265a49db620a39e'... Failed (00:00:25)
Failed installing CPI (00:00:25)
Installing CPI:
Compiling job package dependencies for installation:
Compiling job package dependencies:
Compiling package:
Running command: 'bash -x packaging', stdout: 'Installing ansi 1.5.0
Installing ast 2.4.0
Installing little-plugger 1.1.4
Installing multi_json 1.13.1
Installing logging 1.8.2
Installing semi_semantic 1.2.0
Installing bosh_common 1.3262.24.0
Installing httpclient 2.8.3
Installing membrane 1.1.0
Installing bosh_cpi 2.5.0
Installing builder 3.2.3
Using bundler 1.16.1
Installing ffi 1.9.23 with native extensions
Installing ethon 0.11.0
Installing json 2.1.0 with native extensions
Installing mini_portile2 2.3.0
Installing mono_logger 1.1.0
Installing netaddr 1.5.1
Installing nokogiri 1.8.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/vsphere_cpi/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.2/ext/nokogiri
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bin/ruby
-r ./siteconf20181008-26298-1pss9u1.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
*** 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=/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bin/$(RUBY_BASE_NAME)
--help
--clean
--use-system-libraries
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in
`require': cannot load such file -- openssl (LoadError)
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in
`require'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/2.4.0/net/https.rb:23:in
`<top (required)>'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in
`require'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in
`require'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/vsphere_cpi/vendor/bundle/ruby/2.4.0/gems/mini_portile2-2.3.0/lib/mini_portile2/mini_portile.rb:3:in
`<top (required)>'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in
`require'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in
`require'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/vsphere_cpi/vendor/bundle/ruby/2.4.0/gems/mini_portile2-2.3.0/lib/mini_portile2.rb:2:in
`<top (required)>'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in
`require'
from
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in
`require'
from extconf.rb:464:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/vsphere_cpi/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/nokogiri-1.8.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/vsphere_cpi/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.2
for inspection.
Results logged to
/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/vsphere_cpi/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/nokogiri-1.8.2/gem_make.out
An error occurred while installing nokogiri (1.8.2), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.8.2'` succeeds before bundling.
In Gemfile:
nokogiri
', stderr: '+ set -e
+ BOSH_PACKAGES_DIR=/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages
+ source /home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bosh/compile.env
++ source /home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bosh/runtime.env
+++ export PATH=/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bin:/usr/local/bin:/usr/bin:/bin
+++ PATH=/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bin:/usr/local/bin:/usr/bin:/bin
+++ export GEMRC=/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bosh/gemrc
+++ GEMRC=/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bosh/gemrc
+ cp -a vsphere_cpi/Gemfile vsphere_cpi/Gemfile.lock vsphere_cpi/bin vsphere_cpi/lib vsphere_cpi/vendor /home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/vsphere_cpi
+ export BUNDLE_CACHE_PATH=vendor/package
+ BUNDLE_CACHE_PATH=vendor/package
+ export BUNDLE_WITHOUT=development:test
+ BUNDLE_WITHOUT=development:test
+ bundle_cmd=/home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bin/bundle
+ cd /home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/vsphere_cpi
+ /home/vagrant/.bosh/installations/98f4ddb2-c479-4b05-521a-db08d89ebc6d/packages/ruby-2.4-r4/bin/bundle install --local --no-prune --deployment
':
exit status 5
Exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment