# Beginner problem

**URL:** <https://www.ruby-forum.com/t/beginner-problem/180550>\
**Category:** Rails\
**Created:** [December 21, 2009, 4:36pm UTC](https://www.ruby-forum.com/t/beginner-problem/180550 "2009-12-21T16:36:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![erwillie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c0e974/32.png) [@erwillie](https://www.ruby-forum.com/u/erwillie)\
**Post date:** [December 21, 2009, 4:36pm UTC](https://www.ruby-forum.com/t/beginner-problem/180550/1 "2009-12-21T16:36:44Z")

</div>

Hi,  
IÂ´m starting using rails. I have one problem. I create a controller, the  
code is the next:  
class PlayersController \< ApplicationController  
scaffold:player  
end

I did all the things that I suppose to do, but a problem appears when  
try to open my webpage application. The error is the next  
NoMethodError in PlayersController#index

undefined method `scaffold’ for PlayersController:Class

RAILS\_ROOT: C:/Instant/rails\_apps/players  
Application Trace | Framework Trace | Full Trace

C:/Instant/rails\_apps/players/app/controllers/players\_controller.rb:2

C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/dependencies.rb:380:in  
`load_without_new_constant_marking' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in`load\_file’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/dependencies.rb:521:in  
`new_constants_in' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in`load\_file’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/dependencies.rb:259:in  
`require_or_load' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in`load\_missing\_constant’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/dependencies.rb:80:in  
`const_missing' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in`const\_missing’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/inflector.rb:361:in  
`constantize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in`each’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/inflector.rb:360:in  
`constantize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in`constantize’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/routing/route\_set.rb:443:in  
`recognize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:87:in  
`dispatch' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in`\_call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:130:in  
`build_middleware_stack' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/query\_cache.rb:29:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in`cache’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/query\_cache.rb:9:in  
`cache' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/connection\_adapters/abstract/connection\_pool.rb:361:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/params\_parser.rb:15:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/failsafe.rb:26:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in  
`synchronize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:114:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:108:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/cgi_process.rb:44:in`dispatch\_cgi’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:101:in  
`dispatch_cgi' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:27:in`dispatch’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:76:in  
`process' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:74:in`synchronize’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:74:in  
`process' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:159:in`process\_client’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in  
`each' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in`process\_client’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in  
`run' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in`initialize’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in  
`new' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in  
`initialize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in`new’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in  
`run' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:282:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:281:in  
`each' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:281:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel\_rails:128:in  
`run' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/command.rb:212:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel\_rails:281  
C:/Instant/ruby/bin/mongrel\_rails:19:in `load’  
C:/Instant/ruby/bin/mongrel\_rails:19

C:/Instant/rails\_apps/players/app/controllers/players\_controller.rb:2  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/dependencies.rb:380:in  
`load_without_new_constant_marking' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:380:in`load\_file’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/dependencies.rb:521:in  
`new_constants_in' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:379:in`load\_file’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/dependencies.rb:259:in  
`require_or_load' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:425:in`load\_missing\_constant’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/dependencies.rb:80:in  
`const_missing' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:92:in`const\_missing’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/inflector.rb:361:in  
`constantize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in`each’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active\_support/inflector.rb:360:in  
`constantize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in`constantize’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/routing/route\_set.rb:443:in  
`recognize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:87:in  
`dispatch' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in`\_call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:130:in  
`build_middleware_stack' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/query\_cache.rb:29:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in`cache’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/query\_cache.rb:9:in  
`cache' C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/connection\_adapters/abstract/connection\_pool.rb:361:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/params\_parser.rb:15:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/failsafe.rb:26:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in  
`synchronize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in`call’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:114:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:108:in  
`call' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/cgi_process.rb:44:in`dispatch\_cgi’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_controller/dispatcher.rb:101:in  
`dispatch_cgi' C:/Instant/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:27:in`dispatch’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:76:in  
`process' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:74:in`synchronize’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/rails.rb:74:in  
`process' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:159:in`process\_client’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in  
`each' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:158:in`process\_client’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in  
`run' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in`initialize’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in  
`new' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:285:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in  
`initialize' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in`new’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel.rb:268:in  
`run' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:282:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:281:in  
`each' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/configurator.rb:281:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel\_rails:128:in  
`run' C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/lib/mongrel/command.rb:212:in`run’  
C:/Instant/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel\_rails:281  
C:/Instant/ruby/bin/mongrel\_rails:19:in `load’  
C:/Instant/ruby/bin/mongrel\_rails:19

Request

Parameters:

None

Show session dump

* * *

Response

Headers:

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

If someone can help me,please

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![erwillie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c0e974/32.png) [@erwillie](https://www.ruby-forum.com/u/erwillie)\
**Post date:** [December 21, 2009, 4:47pm UTC](https://www.ruby-forum.com/t/beginner-problem/180550/2 "2009-12-21T16:47:59Z")

</div>

Guille S. wrote:

> Hi,  
> IÂ´m starting using rails. I have one problem. I create a controller, the  
> code is the next:  
> class PlayersController \< ApplicationController  
> scaffold:player  
> end

“scaffold” is something that you use on the command line, not within  
your code.  
Delete the file in which your controller is.  
Go on the command line, in the root of your rails application.  
Type “ruby script/generate scaffold player name:string”.

---

<div class="post-metadata">

**Author:** ![erwillie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c0e974/32.png) [@erwillie](https://www.ruby-forum.com/u/erwillie)\
**Post date:** [December 21, 2009, 6:59pm UTC](https://www.ruby-forum.com/t/beginner-problem/180550/3 "2009-12-21T18:59:07Z")

</div>

Aldric G. wrote:

> Guille S. wrote:
> 
> > Hi,  
> > IÂ´m starting using rails. I have one problem. I create a controller, the  
> > code is the next:  
> > class PlayersController \< ApplicationController  
> > scaffold:player  
> > end
> 
> “scaffold” is something that you use on the command line, not within  
> your code.  
> Delete the file in which your controller is.  
> Go on the command line, in the root of your rails application.  
> Type “ruby script/generate scaffold player name:string”.

Scaffold was a controller method in Rails 1.x. If you are following a  
tutorial that is having you use it, then you are following a seriously  
outdated tutorial.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![erwillie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c0e974/32.png) [@erwillie](https://www.ruby-forum.com/u/erwillie)\
**Post date:** [December 21, 2009, 10:41pm UTC](https://www.ruby-forum.com/t/beginner-problem/180550/4 "2009-12-21T22:41:01Z")

</div>

2009/12/21 Guille S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> undefined method `scaffold’ for PlayersController:Class

As others have said the scaffold method died a long time ago. I  
suggest looking at the RoR guides at [http://guides.rubyonrails.org/](http://guides.rubyonrails.org/),  
starting with Getting Started obviously.

You will also find google very useful. A google search for undefined  
method scaffold for Class would have provided the answer much quicker  
than asking here.

Good luck

Colin

–

You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
