Rails 3 服务器在启动时崩溃:“不是套接字文件描述符”

发布于 2024-10-21 12:33:39 字数 2171 浏览 0 评论 0原文

我正在尝试开始使用 Ruby on Rails,在我尝试启动服务器之前一切都进展顺利。我收到以下错误:

C:\Users\Ken\workspace\railsHello>rails server
=> Booting WEBrick
=> Rails 3.0.5 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-03-10 19:53:08] INFO  WEBrick 1.3.1
[2011-03-10 19:53:08] INFO  ruby 1.9.2 (2011-02-18) [i386-mingw32]
[2011-03-10 19:53:09] WARN  TCPServer Error: not a socket file descriptor
Exiting
C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize': not a socket file
 descriptor (ArgumentError)
        from C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:73:in `new'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_l
isteners'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:70:in `each'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners'

        from C:/Ruby192/lib/ruby/1.9.1/webrick/server.rb:74:in `listen'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/handler/web
rick.rb:10:in `new'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/handler/web
rick.rb:10:in `run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:2
13:in `start'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/comman
ds/server.rb:65:in `start'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/comman
ds.rb:30:in `block in <top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/comman
ds.rb:27:in `tap'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/comman
ds.rb:27:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

C:\Users\Ken\workspace\railsHello>

我什至不知道从哪里开始“TCPServer 错误:不是套接字文件描述符”。

通过 Aptana 尝试也没有帮助。

我使用的是 Windows 7 家庭高级版。 Apache已经安装了,但是我把它关掉了,也没有什么区别。

预先感谢您的帮助!

-肯

I'm trying to get started with Ruby on Rails, and it's all gone quite well up until I try to start the server. I get the following error:

C:\Users\Ken\workspace\railsHello>rails server
=> Booting WEBrick
=> Rails 3.0.5 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-03-10 19:53:08] INFO  WEBrick 1.3.1
[2011-03-10 19:53:08] INFO  ruby 1.9.2 (2011-02-18) [i386-mingw32]
[2011-03-10 19:53:09] WARN  TCPServer Error: not a socket file descriptor
Exiting
C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize': not a socket file
 descriptor (ArgumentError)
        from C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:73:in `new'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_l
isteners'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:70:in `each'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners'

        from C:/Ruby192/lib/ruby/1.9.1/webrick/server.rb:74:in `listen'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize'
        from C:/Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/handler/web
rick.rb:10:in `new'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/handler/web
rick.rb:10:in `run'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.1/lib/rack/server.rb:2
13:in `start'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/comman
ds/server.rb:65:in `start'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/comman
ds.rb:30:in `block in <top (required)>'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/comman
ds.rb:27:in `tap'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/comman
ds.rb:27:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

C:\Users\Ken\workspace\railsHello>

I don't even know where to start with "TCPServer Error: Not a socket file descriptor."

Trying it through Aptana didn't help either.

I'm on Windows 7 Home Premium. Apache was already installed, but I shut it down and it didn't make a difference.

Thanks in advance for your help!

-Ken

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

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

发布评论

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

评论(1

飘逸的'云 2024-10-28 12:33:39

您确定没有其他东西正在侦听端口 3000(可能是未关闭的服务器的旧实例)?检查以下内容:

netstat -a -b

如果有,只需终止该应用程序,或在另一个端口上启动 WEBrick;例如,要在端口 8000 上启动它:

rails server --port=8000

Are you sure nothing else is listening on port 3000 (perhaps an old instance of the server that didn't get shut down)? Check the following:

netstat -a -b

If there is, simply kill that application, or start WEBrick on another port; for example, to start it on port 8000:

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