Hi Soeren,

1. ActiveRecord Association modul uses internally an instance variable
klass. nil.klass exception is happening if something with the
association is for whatever reason not correct. Would be great if you
could debug which association is making trouble.

2. undefined method `create' for #<ActiveScaffold::Config::Core:
0x2b68bf9e9190>):
  app/controllers/school_classes_controller.rb 18:
  That s an interesting one. Could you please post your
school_classes_controller.rb.
  What happens at line 18?

--
Volker



On 26 Jan., 21:28, Soren <[email protected]> wrote:
> Just tried to get the application to boot in production mode.
> PROBLEMS!
>
> Here is the log. Still Rails 2.3.5 and AS from sometime in September.
>
> /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> reflection.rb   257     in `source_reflection'
> 1       /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> reflection.rb   257     in `collect'
> 2       /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> reflection.rb   257     in `source_reflection'
> 3       /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> reflection.rb   316     in `derive_class_name'
> 4       /usr/lib64/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
> reflection.rb   112     in `class_name'
> 5       /rails/formdir-dev/vendor/plugins/active_scaffold/lib/extensions/
> reverse_associations.rb         11      in `reverse'
> 6       /rails/formdir-dev/vendor/plugins/active_scaffold/lib/
> active_scaffold/data_structures/column.rb       117     in `autolink?'
> 7       /rails/formdir-dev/vendor/plugins/active_scaffold/lib/
> active_scaffold.rb      107     in `links_for_associations'
> 8       /rails/formdir-dev/vendor/plugins/active_scaffold/lib/
> active_scaffold/data_structures/columns.rb      62      in `each'
> 9       /rails/formdir-dev/vendor/plugins/active_scaffold/lib/
> active_scaffold/data_structures/columns.rb      62      in `each'
> 10      /rails/formdir-dev/vendor/plugins/active_scaffold/lib/
> active_scaffold.rb      106     in `links_for_associations'
> 11      /rails/formdir-dev/vendor/plugins/active_scaffold/lib/
> active_scaffold.rb      59      in `active_scaffold'
> 12      /rails/formdir-dev/app/controllers/campaigns_controller.rb      7
> 13      /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb        32    
>   in
> `gem_original_require'
> 14      /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb        32    
>   in
> `require'
> 15      /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
> active_support/dependencies.rb  158     in `require'
> 16      /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
> active_support/dependencies.rb  265     in `require_or_load'
> 17      /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
> active_support/dependencies.rb  224     in `depend_on'
> 18      /usr/lib64/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
> active_support/dependencies.rb  136     in `require_dependency'
> 19      /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    414
> in `load_application_classes'
> 20      /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    413
> in `each'
> 21      /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    413
> in `load_application_classes'
> 22      /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    411
> in `each'
> 23      /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    411
> in `load_application_classes'
> 24      /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    197
> in `process'
> 25      /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    113
> in `send'
> 26      /usr/lib64/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb    113
> in `run'
> 27      /rails/formdir-dev/config/environment.rb        18
> 28      /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb        32    
>   in
> `gem_original_require'
> 29      /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb        32    
>   in
> `require'
> 30      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/railz/application_spawner.rb  299     in
> `preload_application'
> 31      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/railz/application_spawner.rb  248     in
> `initialize_server'
> 32      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/utils.rb      255     in `report_app_init_status'
> 33      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/railz/application_spawner.rb  233     in
> `initialize_server'
> 34      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/abstract_server.rb    194     in `start_synchronously'
> 35      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/abstract_server.rb    163     in `start'
> 36      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/railz/application_spawner.rb  209     in `start'
> 37      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/spawn_manager.rb      262     in `spawn_rails_application'
> 38      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/abstract_server_collection.rb         126     in
> `lookup_or_add'
> 39      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/spawn_manager.rb      256     in `spawn_rails_application'
> 40      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/abstract_server_collection.rb         80      in 
> `synchronize'
> 41      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/abstract_server_collection.rb         79      in 
> `synchronize'
> 42      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/spawn_manager.rb      255     in `spawn_rails_application'
> 43      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/spawn_manager.rb      154     in `spawn_application'
> 44      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/spawn_manager.rb      287     in `handle_spawn_application'
> 45      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/abstract_server.rb    352     in `__send__'
> 46      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/abstract_server.rb    352     in `main_loop'
> 47      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/lib/
> phusion_passenger/abstract_server.rb    196     in `start_synchronously'
> 48      /usr/lib64/ruby/gems/1.8/gems/passenger-2.2.9/bin/passenger-spawn-
> server  61
>
> On Jan 26, 11:40 am, Soren <[email protected]> wrote:
>
> > I noted that there was a potential for naming conflicts with the klass
> > name used by active scaffold so I have renamed my system to use
> > school_class rather than klass.
>
> > Here is the associations for school_class:
>
> >   has_many :funds
>
> >   has_many :mailings
>
> >   has_many :students
>
> >   has_many :teachers,
> >     :class_name => "Staff",
> >     :conditions => "staffs.role = 'teacher'"
>
> >   has_many :ias,
> >     :class_name => "Staff",
> >     :conditions => "staffs.role = 'ia'"
>
> >   belongs_to :first_contact,
> >     :foreign_key => :first_contact_id,
> >     :class_name => "User"
> >     :conditions => "users.role = 'classco'"
>
> >   belongs_to :second_contact,
> >     :foreign_key => :second_contact_id,
> >     :class_name => "User"
> >     :conditions => "users.role = 'classco'"
>
> > The associated models have their required has_many/belongs_to.
>
> > I found an older version of AS that I has used in another project, and
> > just for the heck of it tried it too see if this might be a problem
> > with the latest version of AS.
> > And it happens to be an issue with the latest version of AS. My older
> > version from September seems to be doing just fine with all my
> > associations, HABTM's etc etc.
>
> > How can I help getting the latest version of AS fixed ?
> > under Rails 2.3.5 and using the HEAD version of AS I see one of two
> > errors:
>
> > NoMethodError (undefined method `create' for
> > #<ActiveScaffold::Config::Core:0x2b68bf9e9190>):
> >   app/controllers/school_classes_controller.rb:
> > 18
> > << This is this line:   active_scaffold :school_class do |config|
> >   passenger (2.2.9) lib/phusion_passenger/rack/request_handler.rb:
> > 92:in `process_request'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_request_handler.rb:
> > 207:in `main_loop'
> >   passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:
> > 400:in `start_request_handler'
> >   passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:
> > 351:in `handle_spawn_application'
> >   passenger (2.2.9) lib/phusion_passenger/utils.rb:184:in `safe_fork'
> >   passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:
> > 349:in `handle_spawn_application'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in
> > `__send__'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in
> > `main_loop'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in
> > `start_synchronously'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:163:in
> > `start'
> >   passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:
> > 209:in `start'
> >   passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:262:in
> > `spawn_rails_application'
> >   passenger (2.2.9) lib/phusion_passenger/
> > abstract_server_collection.rb:126:in `lookup_or_add'
> >   passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:256:in
> > `spawn_rails_application'
> >   passenger (2.2.9) lib/phusion_passenger/
> > abstract_server_collection.rb:80:in `synchronize'
> >   passenger (2.2.9) lib/phusion_passenger/
> > abstract_server_collection.rb:79:in `synchronize'
> >   passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:255:in
> > `spawn_rails_application'
> >   passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:154:in
> > `spawn_application'
> >   passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:287:in
> > `handle_spawn_application'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in
> > `__send__'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in
> > `main_loop'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in
> > `start_synchronously'
>
> > or I get this error:
> > Processing ApplicationController#index (for 192.168.0.216 at
> > 2010-01-26 19:35:27) [GET]
> >   Parameters: {"action"=>"index", "controller"=>"campaigns"}
>
> > NoMethodError (undefined method `klass' for nil:NilClass):
> >   app/controllers/campaigns_controller.rb:
> > 7
> > << This is this line:   active_scaffold :campaign do |config|
> >   passenger (2.2.9) lib/phusion_passenger/rack/request_handler.rb:
> > 92:in `process_request'
> >   passenger (2.2.9) lib/phusion_passenger/abstract_request_handler.rb:
> > 207:in `main_loop'
> >   passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:
> > 400:in `start_request_handler'
> >   passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:
> > 351:in `handle_spawn_application'
> >   passenger (2.2.9) lib/phusion_passenger/utils.rb:184:in `safe_fork'
> >   passenger (2.2.9)
>
> ...
>
> Erfahren Sie mehr »

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to