ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

ActionView::TemplateError (undefined method `new0' for DateTime:Class)

Added by George Plymale at 2012-02-25 07:03 am

Just upgraded to ChiliProject 3.0 today and after having created a new user their login fails (old users login fine). The error is:

ActionView::TemplateError (undefined method `new0' for DateTime:Class) on line #6 of app/views/news/_news.rhtml:
3: <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 >
4: &lt;br /&gt;
5: <
unless news.summary.blank? >&lt;span class="summary"&gt;<%=h news.summary %>&lt;/span&gt;&lt;br /&gt;< end %>
6: &lt;span class="author"&gt;<%= authoring news.created_on, news.author %>&lt;/span&gt;&lt;/p&gt;
(eval):2:in `to_date'
lib/redmine/i18n.rb:54:in `format_date'
lib/redmine/i18n.rb:62:in `format_time'
app/helpers/application_helper.rb:329:in `time_tag'
app/helpers/application_helper.rb:321:in `authoring'
app/views/news/_news.rhtml:6:in `_run_rhtml_app47views47news47_news46rhtml_locals_news_news_counter_object'
app/views/welcome/index.rhtml:8:in `_run_rhtml_app47views47welcome47index46rhtml'
&lt;internal:prelude&gt;:10:in `synchronize'
thin (1.2.11) lib/thin/connection.rb:84:in `block in pre_process'
thin (1.2.11) lib/thin/connection.rb:82:in `catch'
thin (1.2.11) lib/thin/connection.rb:82:in `pre_process'
thin (1.2.11) lib/thin/connection.rb:57:in `process'
thin (1.2.11) lib/thin/connection.rb:42:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.2.11) lib/thin/backends/base.rb:61:in `start'
thin (1.2.11) lib/thin/server.rb:159:in `start'
thin (1.2.11) lib/thin/controllers/controller.rb:86:in `start'
thin (1.2.11) lib/thin/runner.rb:185:in `run_command'
thin (1.2.11) lib/thin/runner.rb:151:in `run!'
thin (1.2.11) bin/thin:6:in `&lt;top (required)&gt;'
/usr/local/rvm/gems/ruby-1.9.3-p125@all/bin/thin:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p125@all/bin/thin:19:in `&lt;main&gt;'

Replies (8)

RE: ActionView::TemplateError (undefined method `new0' for DateTime:Class) - Added by Felix Schäfer at 2012-02-25 07:15 am

Do you have any plugin installed?

The error looks very strange though, and I can't fathom what the relation to new users is, because the error is on showing news (which the new users probably haven't created) and apparently due to a date formatting error, but I can't find any place in the code that would call new0 as the error seems to suggest…

RE: ActionView::TemplateError (undefined method `new0' for DateTime:Class) - Added by George Plymale at 2012-02-25 07:26 am

After having deleted news items from an account that can login, I received the following error for a new user:
https://gist.github.com/02dcd8d642a4f836573c

RE: ActionView::TemplateError (undefined method `new0' for DateTime:Class) - Added by Felix Schäfer at 2012-02-25 07:37 am

It's the same error, I fear it's a problem with the stack on 1.9.3, could you try it on 1.9.2?

RE: ActionView::TemplateError (undefined method `new0' for DateTime:Class) - Added by George Plymale at 2012-02-25 08:03 am

Well Felix, I do have some plugins, but I concur... why would it have a problem with new users vs old users? I've dug around a bit in the database and see nothing in the users nor user_preferences tables that could have any seeming bearing on the situation.

Further, I agree, I see nothing that could evoke that new0 method either. It seems as though it's composing the new + 0 method from a string in the view somehow.

The additional plugins I have are:
redmine_github_hook
redmine_todos_plugin
ruby-net-ldap-0.0.4
stuff_to_do_plugin

After having removed these I obviously must do something else to modify the database to allow their removal as I get the following error:

!! Unexpected error while processing request: Missing helper file helpers/todos_helper.rb
Missing helper file helpers/todos_helper.rb
/usr/local/rvm/gems/ruby-1.9.3-p125@all/gems/actionpack-2.3.14/lib/action_controller/helpers.rb:131:in `rescue in block in helper'
/usr/local/rvm/gems/ruby-1.9.3-p125@all/gems/actionpack-2.3.14/lib/action_controller/helpers.rb:125:in `block in helper'
/usr/local/rvm/gems/ruby-1.9.3-p125@all/gems/actionpack-2.3.14/lib/action_controller/helpers.rb:115:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p125@all/gems/actionpack-2.3.14/lib/action_controller/helpers.rb:115:in `helper'
...

RE: ActionView::TemplateError (undefined method `new0' for DateTime:Class) - Added by George Plymale at 2012-02-25 08:05 am

Will install 1.9.2 as well to see what happens there, but yes, how do I deal with the above issue whilst removing plugins?

RE: ActionView::TemplateError (undefined method `new0' for DateTime:Class) - Added by George Plymale at 2012-02-25 08:24 am

Felix, it appears that you are to correct. I reenabled the plugins and installed 1.9.2-p290 (rvm on freebsd) and it is working fine now.

Certainly something to look into. Any suggestions on an approach to solve this?

RE: ActionView::TemplateError (undefined method `new0' for DateTime:Class) - Added by Felix Schäfer at 2012-02-25 09:11 am

Good to hear, to be honest we haven't started testing on 1.9.3, and I fear it's probably some underlying gem that's at fault. Could you open an issue on the tracker here nonetheless?

(1-8/8)