0

I have an issue with Mongrel cluster start-up, when I start the cluster I am getting the following error: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 'gem_original_require': no such file to load -- /home/admin/test-project/test-app/config/environment (LoadError)

log file link

I am using this command to start the server (as root):

  • cd rails_app_path
  • mongrel_rails cluster::start

For mongrel set-up I did the following (as root):

  1. sudo gem install mongrel --include-dependencies
  2. sudo gem install mongrel_cluster --include-dependencies
  3. create mongrel user useradd -r mongrel
  4. groupadd www-data
  5. chown -R mongrel:www-data
  6. mongrel_rails cluster::configure -e production -p 3007 -N 2 -c -a 127.0.0.1 --user mongrel --group www-data

I have checked the permissions on the files in the config folder and they are as follows:

  • -rw-r--r-- 1 mongrel www-data 2795 Aug 10 03:24 boot.rb
  • -rw-r--r-- 1 mongrel www-data 255 Aug 24 13:01 database.yml
  • -rw-r--r-- 1 mongrel www-data 319 Aug 24 12:51 database.yml.bak
  • -rw-r--r-- 1 mongrel www-data 2086 Aug 27 11:22 environment.rb
  • drwxr-xr-x 2 mongrel www-data 4096 Aug 27 08:46 environments
  • drwxr-xr-x 2 mongrel www-data 4096 Aug 10 03:24 initializers
  • drwxr-xr-x 2 mongrel www-data 4096 Aug 10 03:24 locales
  • -rw-r--r-- 1 mongrel www-data 278 Aug 27 12:09 mongrel_cluster.yml
  • -rw-r--r-- 1 mongrel www-data 4037 Aug 22 09:49 routes.rb

Other details:

  1. OS - CentOS release 5.4
  2. Ruby - v 1.8.7
  3. Gem - v 1.3.7
  4. Rails - v 2.3.8
  5. Mongrel - v 1.1.5
  6. Mongrel Cluster - v 1.0.5

"mongrel_rails start" works fine.

Any help would be appreciated.

Thank you.

Govind Naroji

5
  • mongrel_cluster.yml file link - box.net/shared/2mgso1axfn
    – Govind N
    Aug 27, 2010 at 18:05
  • 2
    certainly doesn't answer your question, but we switched from mongrel to phusion passenger and have never looked back. It's infinitely easier to configure and faster to boot. Never had any problems. Might be worth looking into.
    – brad
    Aug 27, 2010 at 18:07
  • Thanks for the suggestion Brad, Zepplock. Will definitely give Passenger a try. Are you aware of any limitations with Passenger as opposed to Mongrel? Also, I have heard that "With Passenger if the app is idle for a while then it kills off instances and is a bit easier to manage, but if the app is idle for too long there may be none running and the next request will seem slow as it has to start an application instance." Have you faced this problem and is there any way to avoid this?
    – Govind N
    Aug 30, 2010 at 8:12
  • You may also consider switching to Unicorn. For fast clients, it's much faster than either Mongrel or Passenger, and easier to manage than Mongrel (although possibly a bit harder than Passenger). On topic, I've heard that mongrel_cluster got somewhat broken in 2.3.8 on certain configurations, so you might look for the patch in rails lighthouse tickets.
    – buru
    Aug 30, 2010 at 15:06
  • Unicorn is for fast clients, nginx is a fast client. We're running unicorn + nginx and it works like a charm. Sep 1, 2010 at 8:04

2 Answers 2

0

Why are you doing cd /config/environment? You should start your server from the root directory of your application.

1
  • Sorry that was a typo: I am starting it from the app_directory: * cd rails_app_path * mongrel_rails cluster::start
    – Govind N
    Aug 29, 2010 at 12:58
0

I suppose that I was getting this error due to permissions issue. all the files in the app/config folder were owned by mongrel user and I was trying to start it with root user.

I had switched to passenger and I was getting the same issue with passenger. The issue is now resolved - I made the admin user as the owner of all the files in the app and then started the server with user as admin.

We have decided to use passenger instead of mongrel as mongrel_cluster does seem to be broken in 2.3.8 - we are getting an ActionController::InvalidAuthenticityToken error with mongrel which we don't get on passenger or webrick.

So finally its passenger+nginx for us.

Cheers!

Govind Naroji

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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