# Mongrel\_rails command only runs from within apps directory

**URL:** <https://www.ruby-forum.com/t/mongrel-rails-command-only-runs-from-within-apps-directory/84234>\
**Category:** Deployment\
**Created:** [February 2, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/mongrel-rails-command-only-runs-from-within-apps-directory/84234 "2007-02-02T16:58:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [February 2, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/mongrel-rails-command-only-runs-from-within-apps-directory/84234/1 "2007-02-02T16:58:49Z")

</div>

ok so when I run

mongrel\_rails cluster::start -C /path/to/config/file from anywhere on  
my server, I get this error message.

Restarting 2 Mongrel servers…  
!!! PID file log/mongrel.8000.pid does not exist. Not running?  
mongrel::restart reported an error. Use mongrel\_rails mongrel::restart  
-h to get help.  
mongrel\_rails restart -P log/mongrel.8000.pid

!!! PID file log/mongrel.8001.pid does not exist. Not running?  
mongrel::restart reported an error. Use mongrel\_rails mongrel::restart  
-h to get help.  
mongrel\_rails restart -P log/mongrel.8001.pid

But when I run the command

mongrel\_rails cluster::start

from within the apps directory it works as it should.

So this means that capistrano cannot restart the mongrel processes on  
deploy, AND mongrel isnt starting up when my server reboots. I have to  
manually go into both of my apps to start up the processes.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [February 2, 2007, 9:44pm UTC](https://www.ruby-forum.com/t/mongrel-rails-command-only-runs-from-within-apps-directory/84234/2 "2007-02-02T21:44:21Z")

</div>

I think it happens with pre 1.0 Mongrel. When I upgraded to 1.0.1.  
version and created configuration file again it added cwd: /home/myapp/  
current to start of YAML file. Then all worked as expected.

---

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [February 2, 2007, 9:57pm UTC](https://www.ruby-forum.com/t/mongrel-rails-command-only-runs-from-within-apps-directory/84234/3 "2007-02-02T21:57:22Z")

</div>

Hmm that makes sense. I upgraded to the 1.01 mongrel, so you’re saying  
I have to re-create my mongrel file?

---

<div class="post-metadata">

**Author:** ![jcontonio](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9d8465/32.png) [@jcontonio](https://www.ruby-forum.com/u/jcontonio)\
**Post date:** [February 5, 2007, 4:35pm UTC](https://www.ruby-forum.com/t/mongrel-rails-command-only-runs-from-within-apps-directory/84234/4 "2007-02-05T16:35:41Z")

</div>

Likely you need to add…

pid\_file: /path/to/your/pid\_files

into your config YAML, the error is that mongrel command isn’t  
locating the pid file

which it is trying to locate by relative location since no pid\_file  
path was provided.

I don’t think the problem is related to the mongrel version.

/ak
