使用Mongrel_rails在Rails应用程序上启动ruby时为什么会出错 [英] Why do I get an error when starting ruby on rails app with mongrel_rails

查看:210
本文介绍了使用Mongrel_rails在Rails应用程序上启动ruby时为什么会出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么尝试使用

mongrel_rails start

启动Rails应用程序中的Ruby时出现以下错误?

?

 
C:\RailsTest\cookbook2>mongrel_rails start
** WARNING: Win32 does not support daemon mode.
** Daemonized, any open files are closed.  Look at log/mongrel.pid and log/mongr
el.log for info.
** Starting Mongrel listening at 0.0.0.0:3000
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/t
cphack.rb:12:in `initialize_without_backlog': Only one usage of each socket addr
ess (protocol/network address/port) is normally permitted. - bind(2) (Errno::EAD
DRINUSE)
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../
lib/mongrel/tcphack.rb:12:in `initialize'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../
lib/mongrel.rb:93:in `new'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../
lib/mongrel.rb:93:in `initialize'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../
lib/mongrel/configurator.rb:139:in `new'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../
lib/mongrel/configurator.rb:139:in `listener'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mon
grel_rails:99:in `cloaker_'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../
lib/mongrel/configurator.rb:50:in `call'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../
lib/mongrel/configurator.rb:50:in `initialize'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mon
grel_rails:84:in `new'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mon
grel_rails:84:in `run'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../
lib/mongrel/command.rb:212:in `run'
        from c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mon
grel_rails:281
        from c:/ruby/bin/mongrel_rails:19:in `load'
        from c:/ruby/bin/mongrel_rails:19

推荐答案

您已经有一个进程正在监听端口3000(mongrel的默认端口).

You already have a process listening on port 3000 (the default port for mongrel).

尝试:

mongrel_rails start -p 3001

并查看您是否遇到类似的错误.

and see whether you get a similar error.

如果您要安装多个Rails应用,则需要将每个杂种分配给一个单独的端口,并相应地编辑apache conf.

If you're trying to install more than one Rails app, you need to assign each mongrel to a separate port and edit you apache conf accordingly.

如果您不想这样做,杀死所有杂种动物的最直接方法是打开Windows任务管理器并杀死所有红宝石"进程.

If you not trying to do that, the most direct way of killing all mongrels is to open windows task manager and kill all the 'ruby' processes.

请注意,如果您安装了杂种作为自动启动的服务

Note that if you have mongrel installed as a service that starts automatically

mongrel_rails install::service ...

...红宝石过程将自动重新生成.在这种情况下,您将必须通过Windows Services面板编辑过程属性.让我知道您是否需要更多信息.

...the ruby process will regenerate automatically. In that case, you'll have to edit the process properties through the windows services panel. Let me know if you need more info.

这篇关于使用Mongrel_rails在Rails应用程序上启动ruby时为什么会出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆