简体   繁体   English

杂种群集无法启动

[英]Mongrel Cluster fails to start

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) 我在启动集群时遇到Mongrel集群启动问题,出现以下错误: /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:'gem_original_require'中:否要加载的文件-/ 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 cd rails_app_path
  • mongrel_rails cluster::start mongrel_rails集群::开始

For mongrel set-up I did the following (as root): 对于杂种设置,我做了以下操作(作为根用户):

  1. sudo gem install mongrel --include-dependencies sudo gem install mongrel --include-dependencies
  2. sudo gem install mongrel_cluster --include-dependencies sudo gem install mongrel_cluster --include-dependencies
  3. create mongrel user useradd -r mongrel 创建杂种用户useradd -r mongrel
  4. groupadd www-data 组添加www数据
  5. chown -R mongrel:www-data 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 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: 我已经检查了config文件夹中文件的权限,它们如下:

  • -rw-r--r-- 1 mongrel www-data 2795 Aug 10 03:24 boot.rb -rw-r--r-- 1个杂种www-data 2795 8月10日03:24 boot.rb
  • -rw-r--r-- 1 mongrel www-data 255 Aug 24 13:01 database.yml -rw-r--r-- 1个杂种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个杂种www-data 319 Aug 24 12:51 database.yml.bak
  • -rw-r--r-- 1 mongrel www-data 2086 Aug 27 11:22 environment.rb -rw-r--r-- 1个杂种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个杂种www-data 4096 Aug 27 08:46环境
  • drwxr-xr-x 2 mongrel www-data 4096 Aug 10 03:24 initializers drwxr-xr-x 2个杂种www-data 4096 Aug 10 03:24初始值设定项
  • drwxr-xr-x 2 mongrel www-data 4096 Aug 10 03:24 locales drwxr-xr-x 2个杂种www-data 4096 Aug 10 03:24语言环境
  • -rw-r--r-- 1 mongrel www-data 278 Aug 27 12:09 mongrel_cluster.yml -rw-r--r-- 1个杂种www-data 278 Aug 27 12:09 mongrel_cluster.yml
  • -rw-r--r-- 1 mongrel www-data 4037 Aug 22 09:49 routes.rb -rw-r--r-- 1个杂种www-data 4037 Aug 22 09:49 route.rb

Other details: 其他详情:

  1. OS - CentOS release 5.4 操作系统-CentOS 5.4版
  2. Ruby - v 1.8.7 Ruby-1.8.7版
  3. Gem - v 1.3.7 宝石-1.3.7版
  4. Rails - v 2.3.8 Rails-2.3.8版
  5. Mongrel - v 1.1.5 杂种-v 1.1.5
  6. Mongrel Cluster - v 1.0.5 Mongrel群集-v 1.0.5

"mongrel_rails start" works fine. “ mongrel_rails start”工作正常。

Any help would be appreciated. 任何帮助,将不胜感激。

Thank you. 谢谢。

Govind Naroji Govind Naroji

Why are you doing cd /config/environment ? 为什么要执行cd /config/environment You should start your server from the root directory of your application. 您应该从应用程序的根目录启动服务器。

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. app / config文件夹中的所有文件均由mongrel用户拥有,而我试图以root用户启动它。

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. 现在,此问题已得到解决-我以admin用户为该应用程序中所有文件的所有者,然后以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. 我们已决定使用乘客而不是杂种,因为mongrel_cluster在2.3.8中似乎已被破坏-我们收到杂种杂物的ActionController :: InvalidAuthenticityToken错误,而乘客或webrick上却没有。

So finally its passenger+nginx for us. 所以最后是我们的乘客+ nginx。

Cheers! 干杯!

Govind Naroji Govind Naroji

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM