The exception_notification plugin gives this exception under ruby 1.8.6 patchlevel 110:
ActionView::TemplateError (flag after width) on line #3 of ....../vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml
The offending line is:
<%= "%*-s: %s" % [max.length, key,
filter_sensitive_post_data_from_env(key, @request.env
[key].to_s.strip)] %>
The fix is simple, just switch the places of * and -
<%= "%-*s: %s" % [max.length, key,
filter_sensitive_post_data_from_env(key, @request.env
[key].to_s.strip)] %>
To diagnose the problem, I played around with irb using these two simplifications:
- puts "%-*s: %s" % [5, 2, 'strange']
- puts "%*-s: %s" % [5, 2, 'strange']
Results of testing:
- works both on my Mac and my Ubuntu Feisty server.
- only works on my Mac.
My Mac runs ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1].
My Ubuntu Feisty Server runs ruby 1.8.6 (2007-09-23 patchlevel 110) [x86_64-linux]