Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I run 'passenger-memory-stats' on my ubuntu server as root I get the following error :

-bash: passenger-memory-stats: command not found

If I run this command as a user ('deploy' in my case) I get the passenger results but I get the following warning:

*** WARNING: Please run this tool as root. Otherwise the private dirty RSS of processes cannot be determined.

So what I need to know is how can I get 'passenger-memory-stats' to run as root. Any pointers would be greatly appreciated.

* ERROR MESSAGE *

/home/deploy/.rvm/rubies/ruby-1.9.2   p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find   passenger (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError)
from /home/deploy/.rvm/rubies/ruby-1.9.2- p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /home/deploy/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1208:in `gem'
from /home/deploy/.rvm/gems/ruby-1.9.2-p290/bin/passenger-memory-stats:18:in `<main>'
share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

In the end I just re-installed ruby and passenger and now everything seems to be working fine. Not sure what I did last time?

share|improve this answer
add comment

You can determine the full path of an executable file using the command:

$ which passenger-memory-stats

You need to make sure the root PATH includes the path to this executable to be able to execute it. Otherwise, you need to provide the full path to the executable when you want to execute it such as:

$ sudo /path/to/passenger-memory-stats
share|improve this answer
    
When I do 'which passenger-memory-stats' nothing is shown. Am I missing something for 'which' to work? –  Peter Jan 25 '12 at 11:56
    
If you have done this as root, this explain why you can not execute it. If so, try it again as normal user and search for the returned path in root PATH environment variable. –  Khaled Jan 25 '12 at 12:02
    
this is what I get from a normal user: which passenger-memory-stats /home/deploy/.rvm/gems/ruby-1.9.2-p290/bin/passenger-memory-stats . If I do 'sudo /home/deploy/.rvm/gems/ruby-1.9.2-p290/bin/passenger-memory-stats' it will error. I've updated my original post with the error message. Seems odd it can't find passenger when I know its installed :S –  Peter Jan 25 '12 at 12:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.