Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to get mongrel cluster working on my Ubuntu Server Karmic box in preparation to setup Capistrano. I've been trying to get the two to work all day and finally decided to completely remove Capistrano and see if I can just get Mongrel Cluster to work.

I ran this to install mongrel cluster:

gem install mongrel mongrel_cluster

Everything installed fine, when I change into my app's directory...

# mongrel_rails
-bash: mongrel_rails: command not found

I can run it from its install location:

# /var/lib/gems/1.8/bin/mongrel_rails               
Usage: mongrel_rails <command> [options]
Available commands are:

It lets me build the cluster configuration file fine, but when I run the clister:start command:

# /var/lib/gems/1.8/bin/mongrel_rails cluster::start                               
starting port 8000
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not found: mongrel_rails start -d -e production -p 8000 -P tmp/pids/ -l log/mongrel.8000.log

starting port 8001
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not found: mongrel_rails start -d -e production -p 8001 -P tmp/pids/ -l log/mongrel.8001.log

starting port 8002
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31: command not found: mongrel_rails start -d -e production -p 8002 -P tmp/pids/ -l log/mongrel.8002.log

It seems it isnt calling it from the right directory after that command, what can I do to fix this? I tried setting the path previously when trying to set up Capistrano, but the path didnt stay set when Capistrano used ssh to run the commands.

share|improve this question
up vote 0 down vote accepted

Please try this symlink:

ln -s /var/lib/gems/1.8/bin/mongrel_rails /usr/lib/ruby/1.8/rubygems/mongrel_rails
share|improve this answer
I did something similar, but linked it into the /usr/local/bin instead, and it is working now. Now I am trying to figure out why the rewrite conditions are not sending traffic to the proxy_balancer in apache. RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f :::: RewriteRule ^/(.*)$ balancer://my_cluster%{REQUEST_URI} [P,QSA,L] :::: if anyone was curious those are the two lines not redirecting traffic. – trobrock May 4 '10 at 21:17
The Rewrite condition and Rule look fine, Have you restarted apache? – iainlbc May 4 '10 at 21:30
you could add rewrite logging to the virtual host to get some info: RewriteLog logs/rewrite_log ::::: RewriteLogLevel 9 – iainlbc May 4 '10 at 21:34
I did it with RewriteLogLevel 3 and it looks like it is redirecting properly to balancer://my_cluster but I am not getting anything from it, when I go to a single instance of mongrel in my browser I can get the page, but the Proxy doesnt seem to be forwarding to the mongrel instance. – trobrock May 4 '10 at 22:53
Just thought I would say, I fixed this by adding this satement in the Proxy balancer section of my conf file 'Allow from localhost' to allow the local server to make calls to the balancer, other wise it denies all by default – trobrock May 4 '10 at 23:54

Your Answer


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.