# Error on running any controller- Noob question

**URL:** <https://www.ruby-forum.com/t/error-on-running-any-controller-noob-question/166144>\
**Category:** Rails\
**Created:** [April 22, 2009, 9:08am UTC](https://www.ruby-forum.com/t/error-on-running-any-controller-noob-question/166144 "2009-04-22T09:08:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PNDUR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@PNDUR](https://www.ruby-forum.com/u/PNDUR)\
**Post date:** [April 22, 2009, 9:08am UTC](https://www.ruby-forum.com/t/error-on-running-any-controller-noob-question/166144/1 "2009-04-22T09:08:28Z")

</div>

Hi ,

I am running on Vista with webrick …  
When I generate controllers , models and views I get an error as  
under.

C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active\_support/  
dependencies.rb:105:in `const_missing' C:/ROR_lpapp042109/app/controllers/afflnetworks_controller.rb:5:in`index’

I tried reinstalling but kept stumbling on this.

gem -v  
1.3.2  
rails -v  
2.3.2  
ruby -v  
ruby 1.8.6 (2008-08-11 patchlevel 287) {i385-mswin32]

The full stack trace is as under if that helps

C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active\_support/  
dependencies.rb:105:in `const_missing' C:/ROR_lpapp042109/app/controllers/afflnetworks_controller.rb:5:in`index’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
base.rb:1322:in `send' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ base.rb:1322:in`perform\_action\_without\_filters’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
filters.rb:617:in `call_filters' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ filters.rb:610:in`perform\_action\_without\_benchmark’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
benchmarking.rb:68:in `perform_action_without_rescue' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/ core_ext/benchmark.rb:17:in`ms’  
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active\_support/  
core\_ext/benchmark.rb:10:in `realtime' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/ core_ext/benchmark.rb:17:in`ms’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
benchmarking.rb:68:in `perform_action_without_rescue' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ rescue.rb:160:in`perform\_action\_without\_flash’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
flash.rb:141:in `perform_action' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ base.rb:523:in`send’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
base.rb:523:in `process_without_filters' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ filters.rb:606:in`process’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
base.rb:391:in `process' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ base.rb:386:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
routing/route\_set.rb:433:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ dispatcher.rb:88:in`dispatch’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
dispatcher.rb:111:in `_call' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ dispatcher.rb:82:in`initialize’  
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active\_record/  
query\_cache.rb:29:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/ query_cache.rb:29:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active\_record/  
connection\_adapters/abstract/query\_cache.rb:34:in `cache' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/ query_cache.rb:9:in`cache’  
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active\_record/  
query\_cache.rb:28:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:361:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
vendor/rack-1.0/rack/head.rb:9:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ vendor/rack-1.0/rack/methodoverride.rb:24:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
params\_parser.rb:15:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ rewindable_input.rb:25:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
session/cookie\_store.rb:93:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ reloader.rb:9:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
failsafe.rb:11:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ vendor/rack-1.0/rack/lock.rb:11:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
vendor/rack-1.0/rack/lock.rb:11:in `synchronize' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ vendor/rack-1.0/rack/lock.rb:11:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
dispatcher.rb:106:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/static.rb: 31:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
vendor/rack-1.0/rack/urlmap.rb:46:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ vendor/rack-1.0/rack/urlmap.rb:40:in`each’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
vendor/rack-1.0/rack/urlmap.rb:40:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/ log_tailer.rb:17:in`call’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
vendor/rack-1.0/rack/content\_length.rb:13:in `call' C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/ vendor/rack-1.0/rack/handler/webrick.rb:46:in`service’  
C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in`run’  
C:/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in`start’  
C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' C:/Ruby/lib/ruby/1.8/webrick/server.rb:95:in`start’  
C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each' C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in`start’  
C:/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start' C:/Ruby/lib/ruby/1.8/webrick/server.rb:82:in`start’  
C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action\_controller/  
vendor/rack-1.0/rack/handler/webrick.rb:13:in `run' C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:111 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`gem\_original\_require’  
C:/Ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require’  
script/server:3

---

<div class="post-metadata">

**Author:** ![PNDUR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@PNDUR](https://www.ruby-forum.com/u/PNDUR)\
**Post date:** [April 22, 2009, 10:06am UTC](https://www.ruby-forum.com/t/error-on-running-any-controller-noob-question/166144/2 "2009-04-22T10:06:29Z")

</div>

Have you tried looking at afflnetworks\_controller.rb around line 5, the  
error message suggests there is a problem there. It is difficult to  
help  
without more information.

2009/4/22 PNDUR [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![PNDUR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@PNDUR](https://www.ruby-forum.com/u/PNDUR)\
**Post date:** [April 22, 2009, 3:07pm UTC](https://www.ruby-forum.com/t/error-on-running-any-controller-noob-question/166144/3 "2009-04-22T15:07:50Z")

</div>

Thanks for your reply Colin

Yes, I did.

Line 5 reads is @afflnetworks = Afflnetworks…

The default scaffold commmand generated line 5 as under. In both cases  
I get the same above error

def index  
@afflnetworks = Afflnetworks.all

```
respond_to do |format|
  format.html # index.html.erb
  format.xml { render :xml => @afflnetworks }
end

```

end

I changed it to as follows.

def index  
@afflnetworks = Afflnetworks.find(:all)

```
respond_to do |format|
  format.html # index.html.erb
  format.xml { render :xml => @afflnetworks }
end

```

end

---

<div class="post-metadata">

**Author:** ![PNDUR](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@PNDUR](https://www.ruby-forum.com/u/PNDUR)\
**Post date:** [April 22, 2009, 3:14pm UTC](https://www.ruby-forum.com/t/error-on-running-any-controller-noob-question/166144/4 "2009-04-22T15:14:53Z")

</div>

The same thing also happens when I call any method in the controllers  
and all the controllers. Think it is more than just that one line of  
code.
