sensu-plugins / sensu-plugins-couchdb

http://sensu-plugins.io
MIT License
2 stars 4 forks source link

Error with 'rest_client' load? #10

Open fatmcgav opened 6 years ago

fatmcgav commented 6 years ago

I'm attempting to use this plugin with Sensu 1.2.0, however I'm getting the below exception.

/opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rest_client (LoadError)
    from /opt/sensu/embedded/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-plugins-couchdb-2.0.0/bin/check-couchdb-alive.rb:28:in `'
    from /opt/sensu/embedded/bin/check-couchdb-alive.rb:22:in `load'
    from /opt/sensu/embedded/bin/check-couchdb-alive.rb:22:in `'

I'm guessing this is because the 'rest_client' Gem isn't installed, which I've confirmed via the Sensu embedded ruby env:

$ /opt/sensu/embedded/bin/gem list |egrep 'couchdb|rest'
sensu-plugins-couchdb (2.0.0)

So my question is, should this gem have a hard dependency on the 'rest-client' gem?

Edit: As a work-around, the following resolves this issue.

sudo /opt/sensu/embedded/bin/gem install rest-client --no-ri --no-rdoc
lightgh commented 6 years ago

@fatmcgav thanks for the suggestion. That really helped me out. have been battling with this for almost 2 days with no fix. :) :+1: