Rails环境:
Rails版本v2.2.2
Ruby版本1.8.7
ruby-debug (0.10.4)
ruby-debug-base (0.10.5.jb2 mswin32)
ruby-debug-ide (0.4.16)
?
今天用rubymine3.1的debug功能进行调试的时候,发现启动的时候发现了异常,没有找到原因,希望路过的大侠们帮忙解决一下
启动信息:
?
C:\Ruby\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/Ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.16/bin/rdebug-ide --port 3752 -- F:/RailsWorkPlace/depot/script/server -p 3000 -b 127.0.0.1 -e development Fast Debugger (ruby-debug-ide 0.4.16, ruby-debug-base 0.10.5.jb2) listens on 127.0.0.1:3752
?
异常信息:
C:/Ruby/lib/ruby/1.8/webrick/utils.rb:73:in `initialize' C:/Ruby/lib/ruby/1.8/webrick/utils.rb:73:in `new' C:/Ruby/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners' C:/Ruby/lib/ruby/1.8/webrick/utils.rb:70:in `each' C:/Ruby/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners' C:/Ruby/lib/ruby/1.8/webrick/server.rb:75:in `listen' C:/Ruby/lib/ruby/1.8/webrick/server.rb:63:in `initialize' C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:56:in `new' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:56:in `dispatch' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/webrick.rb:66 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' F:/RailsWorkPlace/depot/script/server:3 C:/Ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_load' C:/Ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_program' C:/Ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.16/bin/rdebug-ide:87 -e:1:in `load' -e:1=> Rails 2.2.2 application started on http://127.0.0.1:3000
?
找到原因了,上面是RubyMine中的异常信息,因为中文显示乱码,所以很难定位到出错的地方,我在命令行窗口又启动了一下debug
ruby scripy/server -u
错误信息:
?
[2011-11-01 23:47:26] INFO WEBrick 1.3.1 [2011-11-01 23:47:26] INFO ruby 1.8.7 (2010-08-16) [i386-mingw32] [2011-11-01 23:47:26] WARN TCPServer Error: 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 - bind(2) C:/Ruby/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': 通常每个套接字地址(协议/网络地址/端口)只允许使用一次。 - bind(2) (Errno::EADDRINUSE) from C:/Ruby/lib/ruby/1.8/webrick/utils.rb:73:in `new' from C:/Ruby/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners' from C:/Ruby/lib/ruby/1.8/webrick/utils.rb:70:in `each' from C:/Ruby/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners' from C:/Ruby/lib/ruby/1.8/webrick/server.rb:75:in `listen' from C:/Ruby/lib/ruby/1.8/webrick/server.rb:63:in `initialize' from C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:56:in `new' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:56:in `dispatch' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/webrick.rb:66 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3
?
这个信息就很明显知道哪里出了问题了,启动服务器以后没有关闭,直接进行了debug,端口冲突导致的
?
?