Ruby dhtmlxGrid可编辑网格错误号:ECONRET
我对Ruby和Rails非常陌生 我使用rails 3.0.9和ruby 1.9.2 我使用了本页所示的dhtmlxGrid: 在网格中添加和删除一些条目后,我随机得到以下错误: “错误Errno:ECONNRESET:远程主机关闭了现有连接Ruby dhtmlxGrid可编辑网格错误号:ECONRET,ruby,grid,webrick,Ruby,Grid,Webrick,我对Ruby和Rails非常陌生 我使用rails 3.0.9和ruby 1.9.2 我使用了本页所示的dhtmlxGrid: 在网格中添加和删除一些条目后,我随机得到以下错误: “错误Errno:ECONNRESET:远程主机关闭了现有连接 C:/Railsinstaller/Ruby1.9.2/lib/ruby1.9.1/webrick/httpserver.rb:56 in 'eof?' C:/Railsinstaller/Ruby1.9.2/lib/ruby1.9.1/webrick/
C:/Railsinstaller/Ruby1.9.2/lib/ruby1.9.1/webrick/httpserver.rb:56 in 'eof?'
C:/Railsinstaller/Ruby1.9.2/lib/ruby1.9.1/webrick/httpserver.rb:56 in 'run'
C:/Railsinstaller/Ruby1.9.2/lib/ruby1.9.1/webrick/server.rb:183 in 'block in start_thread'
服务器不会立即崩溃。而是在一些完成的GET请求后随机崩溃。然后,我从Windows收到一个错误,我的Ruby解释器(CUI)1.9.2p290崩溃
如何避免这种不稳定?
我的模型如下所示:
class Timestep < ActiveRecord::Base
has_many :prodcaps, :dependent => :destroy
has_many :demands, :dependent => :destroy
has_many :maxaddcaps, :dependent => :destroy
has_many :addcapcosts, :dependent => :destroy
validates :stepnumber, :presence => true
attr_accessible :stepnumber
end
class TimestepsController < ApplicationController
def view
end
def data
@timesteps = Timestep.all()
end
def dbaction
#called for all db actions
stepnumber = params["c0"]
@mode = params["!nativeeditor_status"]
@id = params["gr_id"]
case @mode
when "inserted"
timestep = Timestep.new
timestep.stepnumber = stepnumber
timestep.save!
@tid = timestep.id
when "deleted"
timestep=Timestep.find(@id)
timestep.destroy
@tid = @id
when "updated"
timestep=Timestep.find(@id)
timestep.stepnumber = stepnumber
timestep.save!
@tid = @id
end
end
end
xml.instruct! :xml, :version=>"1.0"
xml.tag!("rows") do
Timestep.all.each do |timestep|
xml.tag!("row",{ "id" => timestep.id }) do
xml.tag!("cell", timestep.stepnumber)
end
end
end
将应用程序部署到heroku后,此错误不再发生。 在我看来,这只是韦德里克的问题
<script src="/javascripts/codebase/dhtmlxcommon.js" type="text/javascript" charset="utf-8"></script>
<script src="/javascripts/codebase/dhtmlxgrid.js" type="text/javascript" charset="utf-8"></script>
<script src="/javascripts/codebase/dhtmlxgridcell.js" type="text/javascript" charset="utf-8"></script>
<script src="/javascripts/codebase/dhtmlxdataprocessor.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="/javascripts/codebase/dhtmlxgrid.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="/javascripts/codebase/skins/dhtmlxgrid_dhx_skyblue.css" type="text/css" media="screen" charset="utf-8">
<script type="text/javascript" charset="utf-8">
<%#Definiere Funktion zur Aktualisierung der Seite%>
<%#Übernommen von http://www.quackit.com/javascript/javascript_refresh_page.cfm %>
function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}
</script>
xml.instruct! :xml, :version=>"1.0"
xml.tag!("rows") do
Timestep.all.each do |timestep|
xml.tag!("row",{ "id" => timestep.id }) do
xml.tag!("cell", timestep.stepnumber)
end
end
end