divided by 0 errors

Subscribe to divided by 0 errors 4 post(s), 4 voice(s)

 
Avatar Tony 1 post(s) A lot of my pages are getting the following:
ActionView::TemplateError (divided by 0) on line #4 of vendor/plugins/fiveruns_tuneup/views/tuneup/_data.html.erb:
1: <div id='tuneup-data'>
2:   <div id='tuneup-top'>
3:     <div id='tuneup-summary'>
4:       <%= tuneup_bar(tuneup_data.children.first, :id => 'tuneup-root-bar') %>
5:       <%= trend %> <%= tuneup_data.time.to_i %> ms 
6:     </div>
7:     <%= link_to_upload %>
 
Avatar harrylove 1 post(s)

Same as above.
Also getting this:
SystemStackError (stack level too deep):
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:16:in `initialize’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:16:in `new’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:16:in `map’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:16:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `call’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `emit’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `quick_emit’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:15:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:110:in `node_export’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:110:in `add’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:110:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:109:in `each’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:109:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:108:in `seq’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:108:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `call’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `emit’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `quick_emit’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:107:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in `node_export’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in `add’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:18:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:17:in `each’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:17:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:16:in `map’
/opt/local/lib/ruby/1.8/yaml/rubytypes.rb:16:in `to_yaml’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `call’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `emit’
/opt/local/lib/ruby/1.8/yaml.rb:391:in `quick_emit’

 
Avatar pauljclegg 1 post(s)

“Me too”.
I’ll add, however, that my traceback shows the division by zero to be on line 75 of /lib/fiveruns/tuneup/step.rb. Looks like “self.time” is zero, and the case isn’t being handled.
I tried tweaking the code there to set the value to zero in the case where the division is by zero, but then I just never get a good response; I get lots of errors about something in a helper having an unescaped } (unfortunately, this doesn’t seem to have been written into my development.log…)
...Paul

 
Avatar Rachel G Administator 50 post(s)

Hi All,
We are working on fixing this in the plugin. In the mean time, others have been able to fix this issue with the following
Change the line 5 of _data.html.erb to:
<%= link_to trend + tuneup_data.time.to_i.to_s, ’#’ %> ms
(adding the ā€.to_sā€).
Thanks,
Rachel