为什么使用 mongrel_rails 启动 ruby​​ on Rails 应用程序时出现错误

发布于 2024-07-05 15:39:06 字数 2062 浏览 8 评论 0原文

为什么在尝试使用以下命令启动 ruby​​ on Rails 应用程序时会出现以下错误

mongrel_rails start
?

 
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

Why do I get following error when trying to start a ruby on rails application with

mongrel_rails start

?

 
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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

注定孤独终老 2024-07-12 15:39:06

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

尝试一下:

mongrel_rails start -p 3001

看看是否会出现类似的错误。

如果您尝试安装多个 Rails 应用程序,则需要将每个 mongrel 分配给单独的端口并相应地编辑 apache conf。

如果您不想这样做,杀死所有杂种的最直接方法是打开 Windows 任务管理器并杀死所有“ruby”进程。

请注意,如果您将 mongrel 安装为自动启动的服务

mongrel_rails install::service ...

...ruby 进程将自动重新生成。 在这种情况下,您必须通过 Windows 服务面板编辑进程属性。 如果您需要更多信息,请告诉我。

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

Try:

mongrel_rails start -p 3001

and see whether you get a similar error.

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.

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 ...

...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.

岁月如刀 2024-07-12 15:39:06

在 Windows 上,我找到了两种可能的方法来解决此问题:

  1. 解决方法:在另一个端口启动 mongrel Web 服务器
  2. 解决方案:在任务管理器中找到 ruby​​.exe 进程并完成它

On Windows, I found two possible ways for fixing this issue:

  1. Work around: Start the mongrel web server in another port
  2. Solution: Find the ruby.exe process in your task manager and finish it
°如果伤别离去 2024-07-12 15:39:06

我自己不在 Windows 上使用 mongrel,但我猜这个错误相当于 Linux 的“端口正在使用”错误。 您是否正在尝试将服务器绑定到其他设备已经在侦听的端口?

I don't use mongrel on windows myself, but I guess that error is the equivalent of Linux' "port in use" error. Are you trying to bind the server to a port where something else is already listening?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文