整个错误如下
Wed Jan 30 15:16:57 +0800 2008: Read error: #<Errno::ECONNABORTED: 您的主机中的软件放弃了一个已建立
的连接。>
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/http_response.rb:137:in `write'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/http_response.rb:137:in `write'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/http_response.rb:95:in `send_he
ader'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/http_response.rb:146:in `finish
ed'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:165:in `process_client'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in `initialize'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in `new'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:285:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in `initialize'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in `new'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel.rb:268:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:282:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:281:in `each'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/configurator.rb:281:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/bin/mongrel_rails:128:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/lib/mongrel/command.rb:212:in `run'
d:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.3-x86-mswin32/bin/mongrel_rails:281
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_co
nstants_in'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:489:in `load'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/mongrel.rb:64
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `requir
e'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_co
nstants_in'
d:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `requir
e'
d:/ruby/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
d:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
读一个url要生成一个静态文件,控制器里写个方法调用下面的方法把url内容拿到 存文件。
def get_url_content url
#o = open("http://www.baidu.com")
o = open(url)
c = o.read(o.size)
o.close
c
end
问题:
如果传进来的url地址是本服务器(就是当前服务器)的url,会出现《您的主机中的软件放弃了一个已建立》的错误。
如果是别的url例如 http://www.baidu.com 就会没有问题
在一个控制器正在调用一个action的时候,不能open本服务器的url
难道是rails的bug么?
分享到:
- 2008-01-30 16:20
- 浏览 2263
- 评论(2)
- 论坛回复 / 浏览 (2 / 4924)
- 查看更多
相关推荐
ruby on rails 实例 practical rails social networking sites ruby on rails 第三章内容代码,我自己写进去的,导入数据可以直接用,developemnt阶段,test没有做
《Ruby基础教程(第5版)》是一本由日本知名编程专家高桥征义和后藤裕藏共同著作,经过Ruby之父松本行弘审校的编程入门指南。本书专注于教授Ruby 2.3版本的语法和核心概念,旨在帮助初学者轻松掌握这门强大的面向...
0.创建一个项目 代码如下:rials demoshop 1.用脚手架创建产品(控制 模型 显示 数据) 代码如下:script/generate scaffold product title:string description:text image_url:string 2.如果创建错了销毁这些...
以水泥为基体材料,利用稀土发光材料、反光材料制备出水泥基发光材料(LuminescentCementitiousMate-rials,简称LCM),采用强度试验、荧光分光光度计、亮度计、ESEM等测试手段研究LCM的抗折和抗压强度、发光亮度和余辉...
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版中文版
(新[共14])Web开发敏捷之道--应用Rails进行敏捷Web开part04.rar
Web开发敏捷之道--应用Rails进行敏捷Web开发(第2版).part19.rar
This paper describes a set-up for static teat, of erasable phase transition disc mate-rials. It has a power density of more than 8mW/um2, light spot of 1um and variable exposuretime of 0.1 μs to 1 ms
These include a complete laboratory manual for installing, con guring, securing, and experimenting with many of the servers discussed in the text, PowerPoint notes, animation tuto- rials to ...