barttenbrinke / munin-plugins-rails

Collection of munin plugins for ruby on rails server environments
railsdoctors.com
165 stars 34 forks source link

Install munin-plugins-rails in a RVM box getting failed. #13

Open kevincs opened 12 years ago

kevincs commented 12 years ago

request-log-analyzer installed and runs normal

getting '`gem_original_require': no such file to load' error after installed in a RVM environment and ran $ sudo munin-run --debug vida_api_munin_rails_requests

Error:

About to run '/home/appname/.rvm/rubies/ruby-1.8.7-p352/bin/ruby /etc/munin/plugins/app_name_munin_rails_requests'

/home/appname/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in gem_original_require': no such file to load -- munin-plugins-rails (LoadError) from /home/appname/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire' from /etc/munin/plugins/vida_api_munin_rails_requests:52

ebertech commented 12 years ago

I think you'll need to use rvmsudo because sudo doesn't necessarily set the right environment variables

kevincs commented 12 years ago

@ebertech thanks, but get the same result after using $ rvmsudo munin-run --debug vida_api_munin_rails_requests

ebertech commented 12 years ago

oh, right munin-run will use the settings in plugin-conf.d. I need to patch this to support rvm. So, if you go to /etc/munin/plugin-conf.d there should be configuration files that look like vida_api_munin_rails_requests. If you open one up you can see the paths to various commands. You'll want to change command and env.request_log_analyzer. So do a

which ruby

and use that as your command value like this:

command /path/you/got %c

then do:

which request-log-analyzer

and change the env.request_log_analyzer setting to be

env.request_log_analyzer /path/to/request-log-analyzer

kevincs commented 12 years ago

@ebertech thanks for the reply.

which ruby

/usr/bin/ruby

which request-log-analyzer

/usr/bin/request-log-analyzer

But the real request-log-analyzer gem is installed under ~/.rvm/gems/ruby-1.8.7-p352@rails2/gems/request-log-analyzer-1.12.0/bin

if I execute command "./request-log-analyzer" under the above directory. it runs ok

if I execute command "request-log-analyzer", it points to the /user/bin/request-log-analyzer and report error: ~/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems.rb:812:in `report_activate_error': Could not find RubyGem request-log-analyzer (>= 0) (Gem::LoadError)

I have also tried to rm /usr/bin/request-log-analyzer and soft link the ~/.rvm/gems/ruby-1.8.7-p352@rails2/gems/request-log-analyzer-1.12.0/bin/request-log-analyzer to /usr/bin/request-log-analyzer.

it still reports load error when execute request-log-analyzer:

/usr/bin/request-log-analyzer:5:in `require': no such file to load -- request_log_analyzer (LoadError) from /usr/bin/request-log-analyzer:5

ebertech commented 12 years ago

can you run

rvm info

and paste the results here?

evilsocket commented 11 years ago

fixed with @ebertech instructions ... tnx i was getting mad XD