Mongrel_rails configuration file does not exist but it does

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?

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

btw yml is in /etc/mongrel_cluster/mongrel_cluster.yml as well as
app/config/mongrel_cluster.yml

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

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.

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
:slight_smile: 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.

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.

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

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

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