# Mongrel\_rails configuration file does not exist but it does

**URL:** <https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399>\
**Category:** Deployment\
**Created:** [March 20, 2007, 5:11am UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399 "2007-03-20T05:11:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [March 20, 2007, 5:11am UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/1 "2007-03-20T05:11:00Z")

</div>

this is on centos 4 with ruby installed from source. i can start mongrel  
every way but the one i need… mongrel\_cluster\_ctl works from anywhere,  
/etc/init.d/mongrel\_cluster start works, and the one i need -  
“mongrel\_rails cluster::start” works from the app directory but nowhere  
else. instead, when i run it outside the app directory i get an error  
saying “Configuration file does not exist” and when i run “service  
mongrel\_cluster start” i get  
“/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:  
command not found: mongrel\_rails cluster::start -c mongrel\_cluster.yml  
mongrel\_rails cluster::start returned an error”

line 27 of custom\_require.rb is "def require(path) # :nodoc: "

without mongrel\_rails cluster::start i can’t run the capistrano  
deployment and mongrel\_cluster won’t start on boot. any suggestions?

---

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [March 20, 2007, 2:56pm UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/2 "2007-03-20T14:56:45Z")

</div>

Hi:

When not in RAILS\_ROOT, you need to pass the path of the configuration  
file to the start command. From RAILS\_ROOT, the default is the  
relative path of ‘config/mongrel\_cluster.yml’.

mongrel\_rails cluster::start -C /etc/mongrel\_cluster/  
mongrel\_cluster.yml

You can also use, ‘mongrel\_cluster\_ctl start’ which will start all  
clusters in /etc/mongrel\_cluster.

Regards,  
Bradley Taylor  
[http://railsmachine.com](http://railsmachine.com)

---

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [March 20, 2007, 5:28am UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/3 "2007-03-20T05:28:46Z")

</div>

btw yml is in /etc/mongrel\_cluster/mongrel\_cluster.yml as well as  
app/config/mongrel\_cluster.yml

---

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [March 20, 2007, 5:46pm UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/4 "2007-03-20T17:46:37Z")

</div>

Bradley Taylor wrote:

> Hi:
> 
> When not in RAILS\_ROOT, you need to pass the path of the configuration  
> file to the start command. From RAILS\_ROOT, the default is the  
> relative path of ‘config/mongrel\_cluster.yml’.
> 
> mongrel\_rails cluster::start -C /etc/mongrel\_cluster/  
> mongrel\_cluster.yml
> 
> You can also use, ‘mongrel\_cluster\_ctl start’ which will start all  
> clusters in /etc/mongrel\_cluster.
> 
> Regards,  
> Bradley Taylor  
> [http://railsmachine.com](http://railsmachine.com)

Sorry Bradley, i forgot to mention it works when manually entering the  
path to the config… my bad. the problem is in situations where i don’t  
have the option to pass the path… deployment and boot. i came across  
the info about setting the config path for cap in the deploy.rb. and am  
going to work that out right now, but how do i set the proper path to  
allow the service to start, and consequently get it to start on boot?  
looking at the boot.log there are 4 entries regarding the cluster, all  
at 12:05:45. first entry is the custom require.rb error mentioned above,  
next entry is “localhost mongrel\_cluster: Starting all  
mongrel\_clusters…”, next entry is “localhost mongrel\_cluster:  
mongrel\_rails cluster::start returned an error”, then strangely the next  
is “localhost rc: Starting mongrel\_cluster: succeeded” but it doesn’t.  
no process and no ports listening. so, like i mentioned, how do i get it  
to look at the right path for boot?

thanks much.

---

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [March 20, 2007, 6:33pm UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/5 "2007-03-20T18:33:21Z")

</div>

Scott B. wrote:

> What about setting the cwd in your mongrel yaml file:
> 
> cwd: “/home/onlinerss/onlinerss/current”  
> environment: “production”  
> #address: “127.0.0.1”  
> port: 3000  
> pid\_file: “log/mongrel.pid”  
> servers: 2
> 
> -Scott B.

thats done. the problem with that is that that is the file that  
mongrel\_rails cluster::start is trying to find. (that was a lot of thats  
🙂 so if i get it to see that then the problem is already solved.

im working on the deployment right now, hopefully getting it seen in the  
deploy will somehow help with the boot problem.

---

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [March 20, 2007, 6:16pm UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/6 "2007-03-20T18:16:03Z")

</div>

What about setting the cwd in your mongrel yaml file:

cwd: “/home/onlinerss/onlinerss/current”  
environment: “production”  
#address: “127.0.0.1”  
port: 3000  
pid\_file: “log/mongrel.pid”  
servers: 2

-Scott B.

---

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [April 1, 2007, 8:55pm UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/7 "2007-04-01T20:55:29Z")

</div>

> If you’ve installed the mongrel\_cluster script in /etc/init.d, it  
> will by default use /etc/mongrel\_cluster as the path for the  
> configuration files. That script calls ‘mongrel\_cluster\_ctl’ (which  
> also defaults to /etc/mongrel\_cluster). So, an easy way to debug is  
> use ‘sudo mongrel\_cluster\_ctl start -v’ to see why the mongrels are  
> failing to start.

## When I do this, it starts fine. But when I do ‘service mongrel\_cluster start’, it fails: service mongrel\_cluster restart Restarting all mongrel\_clusters… /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21: command not found: mongrel\_rails cluster::stop -c idea.yml mongrel\_rails cluster::stop returned an error. /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21: command not found: mongrel\_rails cluster::start -c idea.yml mongrel\_rails cluster::start returned an error.

It is starting fine with…:  
[root@server2 ~]# mongrel\_cluster\_ctl start -v  
Starting all mongrel\_clusters…  
mongrel\_rails cluster::start -c idea.yml -v  
Starting 1 Mongrel servers…  
mongrel\_rails start -d -e development -p 20000 -a 0.0.0.0 -P  
log/mongrel.20000.pid -c /home/guest/kc/idea-virtusa/idea --user mongrel  
–group mongrel

Any ideas?

Thanks,  
kc

---

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [March 20, 2007, 7:30pm UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/8 "2007-03-20T19:30:24Z")

</div>

Hi Joe:

If you’ve installed the mongrel\_cluster script in /etc/init.d, it  
will by default use /etc/mongrel\_cluster as the path for the  
configuration files. That script calls ‘mongrel\_cluster\_ctl’ (which  
also defaults to /etc/mongrel\_cluster). So, an easy way to debug is  
use ‘sudo mongrel\_cluster\_ctl start -v’ to see why the mongrels are  
failing to start.

Regards,  
Bradley Taylor  
[http://railsmachine.com](http://railsmachine.com)

---

<div class="post-metadata">

**Author:** ![jz176](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@jz176](https://www.ruby-forum.com/u/jz176)\
**Post date:** [April 2, 2007, 7:09am UTC](https://www.ruby-forum.com/t/mongrel-rails-configuration-file-does-not-exist-but-it-does/89399/9 "2007-04-02T07:09:58Z")

</div>

I have solved the problem.

The poor machine was crying hoarse that it could not find ’  
mongrel\_rails’…  
All I did was link my mongrel\_cluster which was in /usr/local/bin to  
/usr/bin  
and everything fell into place.

ln -s /usr/local/bin/mongrel\_rails /usr/bin/mongrel\_rails

I am leaving the complete message intact below in case somebody else has  
the same problem.

Thanks,  
kc  
kc wrote:

> > If you’ve installed the mongrel\_cluster script in /etc/init.d, it  
> > will by default use /etc/mongrel\_cluster as the path for the  
> > configuration files. That script calls ‘mongrel\_cluster\_ctl’ (which  
> > also defaults to /etc/mongrel\_cluster). So, an easy way to debug is  
> > use ‘sudo mongrel\_cluster\_ctl start -v’ to see why the mongrels are  
> > failing to start.
> 
> ## When I do this, it starts fine. But when I do ‘service mongrel\_cluster start’, it fails: service mongrel\_cluster restart Restarting all mongrel\_clusters… /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21: command not found: mongrel\_rails cluster::stop -c idea.yml mongrel\_rails cluster::stop returned an error. /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21: command not found: mongrel\_rails cluster::start -c idea.yml mongrel\_rails cluster::start returned an error.
> 
> It is starting fine with…:  
> [root@server2 ~]# mongrel\_cluster\_ctl start -v  
> Starting all mongrel\_clusters…  
> mongrel\_rails cluster::start -c idea.yml -v  
> Starting 1 Mongrel servers…  
> mongrel\_rails start -d -e development -p 20000 -a 0.0.0.0 -P  
> log/mongrel.20000.pid -c /home/guest/kc/idea-virtusa/idea --user mongrel  
> –group mongrel
> 
> Any ideas?
> 
> Thanks,  
> kc
