我或多或少是Ruby on Rails的新手,但我的任务是调试一个不再存在的家伙写的Rails应用程序。该应用程序在满洲人上运行,使用:
·Windows XP Professional
·Apache 2.2
·Rails 2.3.8
·混合(1.1.5 x86-mingw32)
·mongrel_service (0.3.4 i386-mswin32)
我从服务器上复制了应用程序,并在我的个人机器上做了一些调试。我只是在我的个人机器上设置了一个Git存储库,并将其克隆回服务器。一切看起来都很好,除了mongrel_service不再工作。每次我尝试从Windows“服务”工具启动服务时,我得到这个错误:本地计算机上的MYAPP_Mongrel_As_Service服务启动,然后停止。如果某些服务没有工作可做,则会自动停止,例如,我尝试使用以下命令删除该服务的性能日志和警报服务:
C:\MyApp>mongrel_rails service::remove --name MYAPP_Mongrel_As_Service
Stopping MYAPP_Mongrel_As_Service if running...
MYAPP_Mongrel_As_Service service removed并使用以下命令重新安装:
C:\MyApp>mongrel_rails service::install --name MYAPP_Mongrel_As_Service -c "C:\MyApp" --port 3001 --env
ironment production --address localhost --log "log\mongrel_as_service.log" --pid "tmp\pids\mongrel_a
s_service.pid"
MYAPP_Mongrel_As_Service service created.但是无论我尝试了多少次,或者使用了什么选项,我都不能让服务运行。奇怪的是,我可以让mongrel自己启动。
C:\MyApp>mongrel_rails start -c c:\MyApp --port 3001 --environment production --address localhost --
g "c:\MyApp\log\mongrel_as_service.log" --pid "C:\MyApp\tmp\pids\mongrel_as_service.pid"
** Starting Mongrel listening at localhost:3001
** Starting Rails with production environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. INT => stop (no restart).
** Mongrel 1.1.5 available at localhost:3001
** Use CTRL-C to stop.当我尝试将它作为服务启动时,它就不起作用了。我在这个问题上搜索了很多,但我找不到任何东西来解决这个问题。奇怪的是,它以前是可以工作的,但现在它不能工作了,一定是我的service::install line出了什么问题,因为我也不能让原始的未经编辑的Rails应用程序在mongrel_as_service上工作。
发布于 2011-04-27 22:30:24
我想通了。结果发现我的文件中不存在mongrel_service的日志文件。为了解决这个问题,我只是创建了一个空白文本文件,并将其重命名为我的日志文件的名称。它就像一个护身符一样有效。奇怪的是,如果mongrel_service不能检测到它,它不会生成自己的日志文件,但是哦,好吧。
https://stackoverflow.com/questions/5797849
复制相似问题