Forum: Ruby on Rails undefined method `scafford'

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2f68b3e798a72ed86792cb754def348b?d=identicon&s=25 gary (Guest)
on 2005-11-17 07:34
(Received via mailing list)
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:in `eval'
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:in
`load'
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:in
`depend_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:in
`require_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:in
`const_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:in
`const_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:in
`traverse_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:in
`dispatch'
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: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:155:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'
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: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:in
`require__'
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: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:in
`require__'
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: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:in
`load'
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:in
`depend_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:in
`require_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:in
`const_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:in
`const_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:in `traverse_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:in
`traverse_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:in
`recognize!'
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:in
`handle_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:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'
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: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:in
`require__'
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: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:in
`require__'
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:in
`require'
script/server:3

This error occured while loading the following files:
   ./script/../config/../app/controllers/recipe_controller.rb
2a0f7bd2c54fbc44329d69555b96f1c5?d=identicon&s=25 kevin.jackson (Guest)
on 2005-11-17 07:34
(Received via mailing list)
>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
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 pergesu (Guest)
on 2005-11-17 07:34
(Received via mailing list)
I'm guessing you just have a typo somewhere...it ought to be
'scaffold' rather than 'scafford'.


On 11/16/05, gary@freemail.thewolfenet.com
5565e460a42fbe5669b458b2753f8d34?d=identicon&s=25 codeslush (Guest)
on 2005-11-17 07:37
(Received via mailing list)
Gary,

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

  Michael


"gary@freemail.thewolfenet.com" <gary@freemail.thewolfenet.com> 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:in `eval'
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:in
`load'
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:in
`depend_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:in
`require_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:in
`const_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:in
`const_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:in
`traverse_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:in
`dispatch'
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: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:155:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'
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: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:in
`require__'
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: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:in
`require__'
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: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:in
`load'
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:in
`depend_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:in
`require_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:in
`const_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:in
`const_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:in `traverse_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:in
`traverse_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:in
`recognize!'
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:in
`handle_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:in `service'
c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
c:/ruby/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
c:/ruby/lib/ruby/1.8/webrick/server.rb:94:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `each'
c:/ruby/lib/ruby/1.8/webrick/server.rb:89:in `start'
c:/ruby/lib/ruby/1.8/webrick/server.rb:79:in `start'
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: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:in
`require__'
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: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:in
`require__'
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:in
`require'
script/server:3

This error occured while loading the following files:
./script/../config/../app/controllers/recipe_controller.rb
E24b2a1d71b7365186a934a09ee6f7c3?d=identicon&s=25 kihlbom (Guest)
on 2005-11-17 08:52
(Received via mailing list)
Sometimes the actual error is indicated by the error message :-)
This topic is locked and can not be replied to.