Open SiKing opened 8 years ago
@SiKing check if you have installed gcc-c++ and libstbc packages. They are needed to compile this plugin.
I thought this was all Ruby? Also: Is this a new requirement? They were not needed for version 0.3.0, as you can see above.
Would be nice to list those things as dependencies in the documentation.
I think I'm having a similar issue. This is FreeBSD 11 with sensu-0.26.3-1
. I'm not sure if I need additional packages installed, any idea?
gcc-ecj-4.5 Eclipse Java Compiler used to build GCC Java
gcc48-4.8.5_1 GNU Compiler Collection 4.8
$ sudo sensu-install -p sensu-plugins-http
[SENSU-INSTALL] installing Sensu plugins ...
[SENSU-INSTALL] determining if Sensu gem 'sensu-plugins-http' is already installed ...
false
[SENSU-INSTALL] Sensu plugin gems to be installed: ["sensu-plugins-http"]
[SENSU-INSTALL] installing Sensu gem 'sensu-plugins-http'
Building native extensions. This could take a while...
ERROR: Error installing sensu-plugins-http:
ERROR: Failed to build gem native extension.
current directory: /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.7.2/ext/unf_ext
/opt/sensu/embedded/bin/ruby -r ./siteconf20170310-2423-1pu1ln2.rb extconf.rb
checking for main() in -lstdc++... *** 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/sensu/embedded/bin/$(RUBY_BASE_NAME)
--with-static-libstdc++
--without-static-libstdc++
--with-stdc++lib
--without-stdc++lib
/opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:541:in `try_link0'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:765:in `try_func'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:997:in `block in have_library'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from /opt/sensu/embedded/lib/ruby/2.3.0/mkmf.rb:992:in `have_library'
from extconf.rb:6:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/opt/sensu/embedded/lib/ruby/gems/2.3.0/extensions/x86_64-freebsd-10/2.3.0/unf_ext-0.0.7.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.7.2 for inspection.
Results logged to /opt/sensu/embedded/lib/ruby/gems/2.3.0/extensions/x86_64-freebsd-10/2.3.0/unf_ext-0.0.7.2/gem_make.out
[SENSU-INSTALL] failed to install Sensu gem 'sensu-plugins-http'
[SENSU-INSTALL] you can run the sensu-install command again with --verbose for more info
[SENSU-INSTALL] please take note of any failure messages above
[SENSU-INSTALL] make sure you have build tools installed (e.g. gcc)
[SENSU-INSTALL] trying to determine the Sensu plugin homepage for sensu-plugins-http ...
homepage: https://github.com/sensu-plugins/sensu-plugins-http
Do you happen to have the BSD equivalent of ruby-dev?
I was able to install devel/ruby-gems
https://www.freshports.org/devel/ruby-gems/ but that didn't solve the problem. I can't find any other port that seem to match ruby-dev.
Anyways I still wasn't able to install the plugin with sensu-install. Using the system wide gem installed by the port above I was able to install and compile a working copy by running gem install sensu-plugins-http
. The downside to this is that the checks are installed to the system bin folder and not the Sensu /opt folder. Not a very big deal since I can always copy them over, symlink or set a path in my checks.
apt-get install g++ libstdc++6 libstdc++-4.9-dev
You can close the issue.
If we have a dependency of gcc then we need to document it to help users. Would someone be willing to put together a PR to document this?
@majormoses I can start converting and improving the Readme, but I will probably need some input there. Have you been added to contributors, so that you can commit to an open PR if allowed?
Yes I am now a maintainer and can ensure that any sane contribution goes through.
@GhostLyrics were you still looking to put together something?
I will try to have something within the next 7 days. If I don't, it is unlikely that I'll find time soon.
Working on it right now, will post link to branch or PR as soon as I can.
The latest sensu-plugins-http fails to install.
Actual behaviour:
Expected behaviour: