Undefined method `scafford'


#1

I went through the tutorial.

I assume this is because of my mysql path is not set right but I have
tried connecting to the host
/ port combinatrion and the socket connection. How would I know what the
socket value should be ?
mysql version = 5.0.15-nt
rails version =
[2005-11-17 01:29:30] INFO WEBrick 1.3.1
[2005-11-17 01:29:30] INFO ruby 1.8.2 (2004-12-25) [i386-mswin32]

I grepped for socket in the mysql dir and came up with :

---------- MY-HUGE.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

All interaction with mysqld must be made via Unix sockets or named

pipes.

---------- MY-INNODB-HEAVY-4G.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

sockets or named pipes.

---------- MY-LARGE.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

All interaction with mysqld must be made via Unix sockets or named

pipes.

---------- MY-MEDIUM.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

All interaction with mysqld must be made via Unix sockets or named

pipes.

---------- MY-SMALL.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

All interaction with mysqld must be made via Unix sockets or named

pipes.

---------- MY-TEMPLATE.INI
socket=mysql
socket=mysql

So I made my yml file below.

development:
adapter: mysql
database: cookbook
username: root
password: ******
#host: 127.0.0.1
#port: 3306
socket: /tmp/mysql.sock

This is the specific error:

undefined method `scafford’ for RecipeController:Class

RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/app/controllers/recipe_controller.rb:2
routing.rb:234:in traverse_to_controller' generated/routing/recognition.rb:3:ineval’
generated/routing/recognition.rb:3:in `recognize_path’

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:in
load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:inload’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:39:in
require_or_load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:22:independ_on’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:in
require_dependency' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:inrequire_dependency’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:134:in
load_file!' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:97:inconst_load!’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:80:in
each' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:80:inconst_load!’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:72:in
const_missing' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/routing.rb:234:intraverse_to_controller’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/routing.rb:458:in
recognize!' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb:38:indispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:117:in
handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:83:inservice’
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:instart’
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:94:instart’
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in each' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:instart’
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:instart’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:69:in
dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/servers/webrick.rb:59 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire__’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:inrequire’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/server.rb:28
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require__' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:in
`require’
script/server:3

#{RAILS_ROOT}/app/controllers/recipe_controller.rb:2
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:in
load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:inload’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:39:in
require_or_load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:22:independ_on’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:in
require_dependency' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:inrequire_dependency’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:134:in
load_file!' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:97:inconst_load!’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:80:in
each' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:80:inconst_load!’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:72:in
const_missing' routing.rb:234:intraverse_to_controller’
generated/routing/recognition.rb:3:in eval' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/routing.rb:234:intraverse_to_controller’
generated/routing/recognition.rb:3:in recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/routing.rb:458:inrecognize!’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb:38:in
dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:117:inhandle_dispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:83:in
service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in run' c:/ruby/lib/ruby/1.8/webrick/server.rb:155:instart_thread’
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:instart_thread’
c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:ineach’
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:instart’
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in start' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:69:indispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/servers/webrick.rb:59
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require__' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:in
require' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/server.rb:28 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire__’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:inrequire’
script/server:3

This error occured while loading the following files:
./script/…/config/…/app/controllers/recipe_controller.rb


#2

undefined method `scafford’ for RecipeController:Class

RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace

my guess is a typo on line 2 of your recipe_controller.rb

see if it says scafford :recipe

if it does change it to scaffold :recipe

Kev


#3

Gary,

Could this be a type? Change to “scaffold” instead of “scafford” and
see what happens.

Michael

“removed_email_address@domain.invalid” removed_email_address@domain.invalid wrote:
I went through the tutorial.

I assume this is because of my mysql path is not set right but I have
tried connecting to the host
/ port combinatrion and the socket connection. How would I know what the
socket value should be ?
mysql version = 5.0.15-nt
rails version =
[2005-11-17 01:29:30] INFO WEBrick 1.3.1
[2005-11-17 01:29:30] INFO ruby 1.8.2 (2004-12-25) [i386-mswin32]

I grepped for socket in the mysql dir and came up with :

---------- MY-HUGE.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

All interaction with mysqld must be made via Unix sockets or named

pipes.

---------- MY-INNODB-HEAVY-4G.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

sockets or named pipes.

---------- MY-LARGE.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

All interaction with mysqld must be made via Unix sockets or named

pipes.

---------- MY-MEDIUM.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

All interaction with mysqld must be made via Unix sockets or named

pipes.

---------- MY-SMALL.INI
socket = /tmp/mysql.sock
socket = /tmp/mysql.sock

All interaction with mysqld must be made via Unix sockets or named

pipes.

---------- MY-TEMPLATE.INI
socket=mysql
socket=mysql

So I made my yml file below.

development:
adapter: mysql
database: cookbook
username: root
password: ******
#host: 127.0.0.1
#port: 3306
socket: /tmp/mysql.sock

This is the specific error:

undefined method `scafford’ for RecipeController:Class

RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace

#{RAILS_ROOT}/app/controllers/recipe_controller.rb:2
routing.rb:234:in traverse_to_controller' generated/routing/recognition.rb:3:ineval’
generated/routing/recognition.rb:3:in `recognize_path’

c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:in
load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:inload’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:39:in
require_or_load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:22:independ_on’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:in
require_dependency' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:inrequire_dependency’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:134:in
load_file!' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:97:inconst_load!’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:80:in
each' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:80:inconst_load!’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:72:in
const_missing' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/routing.rb:234:intraverse_to_controller’
c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/routing.rb:458:in
recognize!' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb:38:indispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:117:in
handle_dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:83:inservice’
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:instart’
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in start_thread' c:/ruby/lib/ruby/1.8/webrick/server.rb:94:instart’
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in each' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:instart’
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:instart’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:69:in
dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/servers/webrick.rb:59 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire__’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:inrequire’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/server.rb:28
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require__' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:in
`require’
script/server:3

#{RAILS_ROOT}/app/controllers/recipe_controller.rb:2
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:in
load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:207:inload’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:39:in
require_or_load' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:22:independ_on’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:in
require_dependency' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:178:inrequire_dependency’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:134:in
load_file!' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:97:inconst_load!’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:80:in
each' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:80:inconst_load!’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:72:in
const_missing' routing.rb:234:intraverse_to_controller’
generated/routing/recognition.rb:3:in eval' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/routing.rb:234:intraverse_to_controller’
generated/routing/recognition.rb:3:in recognize_path' c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.11.0/lib/action_controller/routing.rb:458:inrecognize!’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/dispatcher.rb:38:in
dispatch' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:117:inhandle_dispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:83:in
service' c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in run' c:/ruby/lib/ruby/1.8/webrick/server.rb:155:instart_thread’
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:144:instart_thread’
c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:89:ineach’
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in start' c:/ruby/lib/ruby/1.8/webrick/server.rb:79:instart’
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in start' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/webrick_server.rb:69:indispatch’
c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/servers/webrick.rb:59
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require__' c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:in
require' c:/ruby/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/commands/server.rb:28 c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire__’
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.2.3/lib/active_support/dependencies.rb:214:inrequire’
script/server:3

This error occured while loading the following files:
./script/…/config/…/app/controllers/recipe_controller.rb


#4

Sometimes the actual error is indicated by the error message :slight_smile:


#5

I’m guessing you just have a typo somewhere…it ought to be
‘scaffold’ rather than ‘scafford’.

On 11/16/05, removed_email_address@domain.invalid