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.

Error - NoMethodError in DocumentsController#index

Added by Julien Husson at 2013-07-24 05:49 pm

Hi ChiliProject community,

I've installed Chiliproject on my x64 Ubuntu 13.04 PC.

All it's ok but i've got an error when i open Document Menu >>

@ NoMethodError in DocumentsController#index

undefined method `id' for nil:NilClass

RAILS_ROOT: /var/www/chiliproject/chiliproject
Application Trace | Framework Trace | Full Trace

/var/www/chiliproject/chiliproject/app/models/document.rb:46:in `after_initialize'
/var/lib/gems/1.9.1/gems/activerecord-2.3.18/lib/active_record/callbacks.rb:347:in `callback'
/var/lib/gems/1.9.1/gems/activerecord-2.3.18/lib/active_record/base.rb:2488:in `initialize'
/var/lib/gems/1.9.1/gems/activerecord-2.3.18/lib/active_record/reflection.rb:162:in `new'
/var/lib/gems/1.9.1/gems/activerecord-2.3.18/lib/active_record/reflection.rb:162:in `build_association'
/var/lib/gems/1.9.1/gems/activerecord-2.3.18/lib/active_record/associations/association_collection.rb:478:in `build_record'
/var/lib/gems/1.9.1/gems/activerecord-2.3.18/lib/active_record/associations/association_collection.rb:102:in `build'
/var/www/chiliproject/chiliproject/app/controllers/documents_controller.rb:37:in `index'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:1333:in `perform_action'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:617:in `call_filters'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
/var/lib/gems/1.9.1/gems/activesupport-2.3.18/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
/var/lib/gems/1.9.1/gems/activesupport-2.3.18/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/flash.rb:151:in `perform_action_with_flash'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:532:in `process'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/filters.rb:606:in `process_with_filters'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:391:in `process'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/base.rb:386:in `call'
/var/lib/gems/1.9.1/gems/actionpack-2.3.18/lib/action_controller/routing/route_set.rb:438:in `call'

Request

Parameters:

{"project_id"=>"xxxxx"}

Show session dump
Response

Headers:

{"Cache-Control"=>"no-cache",
"Content-Type"=>""}@

If someone can help me

Thx in advance


Replies (3)

RE: Error - NoMethodError in DocumentsController#index - Added by Julien Husson at 2013-08-01 02:57 pm

I think there is the same problem on Chiliproject demo website ...

Am I missing out on something ?

my ruby version is 1.9.2

Thx

RE: Error - NoMethodError in DocumentsController#index - Added by Felix Schäfer at 2013-08-13 02:46 pm

I can confirm this, have a look at #1295 for a fix.

RE: Error - NoMethodError in DocumentsController#index - Added by Julien Husson at 2013-08-13 03:28 pm

Hi Felix,

Thanks a lot,

I've seen the quick fix for Rails 3 users. ( i.e chiliproject/app/models/document.rb )

44 # FIXME: on Rails 3 use this instead
45 # self.category ||= DocumentCategory.default
46 self.category_id = DocumentCategory.default.id if self.category_id == 0

So Rails 3 users just uncomment line 45 and comment line 46.

It worked for me.

(1-3/3)