NoMethodError in AdminController#index

I am newb in ror. I’ve googled and found no concrete answer to my
problem below:

NoMethodError in AdminController#index

undefined method `scaffold’ for AdminController:Class

RAILS_ROOT: /home/darwin/Sites/music_library
Application Trace | Framework Trace | Full Trace

/home/darwin/Sites/music_library/app/controllers/admin_controller.rb:3

/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:380:in load_without_new_constant_marking' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ dependencies.rb:380:inload_file’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:521:in new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ dependencies.rb:379:inload_file’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:259:in require_or_load' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ dependencies.rb:425:inload_missing_constant’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:80:in const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ dependencies.rb:92:inconst_missing’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
inflector.rb:361:in constantize' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ inflector.rb:360:ineach’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
inflector.rb:360:in constantize' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ core_ext/string/inflections.rb:162:inconstantize’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
routing/route_set.rb:443:in recognize' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ routing/route_set.rb:436:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:87:in dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ dispatcher.rb:121:in_call’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:130:in build_middleware_stack' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ query_cache.rb:29:incall’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:29:in call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ connection_adapters/abstract/query_cache.rb:34:incache’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:9:in cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ query_cache.rb:28:incall’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:361:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ string_coercion.rb:25:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb: 24:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
params_parser.rb:15:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ session/cookie_store.rb:93:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
failsafe.rb:26:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
synchronize' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:114:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ reloader.rb:34:inrun’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:108:in call' /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:ineach’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in call' /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb: 17:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:
13:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb: 50:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
/usr/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:instart’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:instart’
/usr/lib/ruby/1.8/webrick/server.rb:92:in each' /usr/lib/ruby/1.8/webrick/server.rb:92:instart’
/usr/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/lib/ruby/1.8/webrick/server.rb:82:instart’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:
14:in run' /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require’
script/server:3

/home/darwin/Sites/music_library/app/controllers/admin_controller.rb:3
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:380:in load_without_new_constant_marking' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ dependencies.rb:380:inload_file’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:521:in new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ dependencies.rb:379:inload_file’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:259:in require_or_load' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ dependencies.rb:425:inload_missing_constant’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
dependencies.rb:80:in const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ dependencies.rb:92:inconst_missing’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
inflector.rb:361:in constantize' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ inflector.rb:360:ineach’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/
inflector.rb:360:in constantize' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ core_ext/string/inflections.rb:162:inconstantize’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
routing/route_set.rb:443:in recognize' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ routing/route_set.rb:436:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:87:in dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ dispatcher.rb:121:in_call’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:130:in build_middleware_stack' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ query_cache.rb:29:incall’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:29:in call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ connection_adapters/abstract/query_cache.rb:34:incache’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:9:in cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ query_cache.rb:28:incall’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_pool.rb:361:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ string_coercion.rb:25:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb: 24:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
params_parser.rb:15:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ session/cookie_store.rb:93:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
failsafe.rb:26:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
synchronize' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:114:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ reloader.rb:34:inrun’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:108:in call' /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:ineach’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in call' /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb: 17:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:
13:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb: 50:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
/usr/lib/ruby/1.8/webrick/server.rb:173:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:instart’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:instart’
/usr/lib/ruby/1.8/webrick/server.rb:92:in each' /usr/lib/ruby/1.8/webrick/server.rb:92:instart’
/usr/lib/ruby/1.8/webrick/server.rb:23:in start' /usr/lib/ruby/1.8/webrick/server.rb:82:instart’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:
14:in run' /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require’
script/server:3

Request

Parameters:

None

Show session dump


Response

Headers:

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

Can someone point me to the right path?

Top link in google:

http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/39739e012b09f97a/7364aa0c8bf5050f

Read the replies about scaffolding basically you’ll need to install the
scaffolding gem:

From a command prompt in your app root:

ruby script/plugin install scaffolding

or install a previous version of rails (if you are working through a
book it’s probably a good idea to use the same version it uses)

gem install rails -v=“1.2.3”

For simplicities sake probably just uninstall your current rails version
(gem uninstall rails) first then install the older version; that way
you’ll know the rails commands are running the correct version.

Cheers
Luke

I still get the same errors when I did option 1

/home/darwin/Sites/music_library/vendor/plugins/scaffolding/lib/
scaffolding.rb:107:in list' /home/darwin/Sites/music_library/vendor/plugins/scaffolding/lib/ scaffolding.rb:95:inindex’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:1331:in send' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ base.rb:1331:inperform_action_without_filters’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
filters.rb:617:in call_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ filters.rb:610:inperform_action_without_benchmark’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
benchmarking.rb:68:in perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ core_ext/benchmark.rb:17:inms’
/usr/lib/ruby/1.8/benchmark.rb:308:in realtime' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ core_ext/benchmark.rb:17:inms’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
benchmarking.rb:68:in perform_action_without_rescue' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ rescue.rb:160:inperform_action_without_flash’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
flash.rb:146:in perform_action' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ base.rb:532:insend’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:532:in process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ filters.rb:606:inprocess’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
base.rb:391:in process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ base.rb:386:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
routing/route_set.rb:437:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ dispatcher.rb:87:indispatch’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
dispatcher.rb:121:in _call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ dispatcher.rb:130:inbuild_middleware_stack’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:29:in call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ query_cache.rb:29:incall’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/query_cache.rb:34:in cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ query_cache.rb:9:incache’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
query_cache.rb:28:in call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/ connection_adapters/abstract/connection_pool.rb:361:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
string_coercion.rb:25:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:
24:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ params_parser.rb:15:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
session/cookie_store.rb:93:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ failsafe.rb:26:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:insynchronize’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ dispatcher.rb:114:incall’
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/
reloader.rb:34:in run' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/ dispatcher.rb:108:incall’
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in
call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in each' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:incall’
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:
17:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb: 13:incall’
/usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:
50:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach’
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart’
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb: 14:inrun’
/usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
script/server:3

On 23 March 2010 20:14, dwhitekiss [email protected] wrote:

I still get the same errors when I did option 1

The error you had before was, from your first post,
NoMethodError in AdminController#index

undefined method `scaffold’ for AdminController:Class

Are you saying you still get that error, and with the trace below?

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs