I have a problem with scaffolds

Hi there I have created some scaffolds, but they dont work for example

=============================================================
$ script/generate scaffold Posts title:string body:text
/usr/lib/ruby/1.8/xmlsimple.rb:275: warning: already initialized
constant KNOWN_OPTIONS
/usr/lib/ruby/1.8/xmlsimple.rb:280: warning: already initialized
constant DEF_KEY_ATTRIBUTES
/usr/lib/ruby/1.8/xmlsimple.rb:281: warning: already initialized
constant DEF_ROOT_NAME
/usr/lib/ruby/1.8/xmlsimple.rb:282: warning: already initialized
constant DEF_CONTENT_KEY
/usr/lib/ruby/1.8/xmlsimple.rb:283: warning: already initialized
constant DEF_XML_DECLARATION
/usr/lib/ruby/1.8/xmlsimple.rb:284: warning: already initialized
constant DEF_ANONYMOUS_TAG
/usr/lib/ruby/1.8/xmlsimple.rb:285: warning: already initialized
constant DEF_FORCE_ARRAY
/usr/lib/ruby/1.8/xmlsimple.rb:286: warning: already initialized
constant DEF_INDENTATION
/usr/lib/ruby/1.8/xmlsimple.rb:287: warning: already initialized
constant DEF_KEY_TO_SYMBOL
:0:Warning: Gem::SourceIndex#search support for Regexp patterns is
deprecated
exists app/models/
exists app/controllers/
exists app/helpers/
create app/views/posts
exists app/views/layouts/
exists test/functional/
exists test/unit/
exists public/stylesheets/
create app/views/posts/index.html.erb
create app/views/posts/show.html.erb
create app/views/posts/new.html.erb
create app/views/posts/edit.html.erb
identical app/views/layouts/posts.html.erb
identical public/stylesheets/scaffold.css
create app/controllers/posts_controller.rb
create test/functional/posts_controller_test.rb
create app/helpers/posts_helper.rb
route map.resources :posts
dependency model
:0:Warning: Gem::SourceIndex#search support for Regexp patterns is
deprecated
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/posts.rb
create test/unit/posts_test.rb
create test/fixtures/posts.yml
exists db/migrate
create db/migrate/20090925154641_create_posts.rb
$ rm db/development.sqlite3 db/schema.rb
$ rake db:migrate

the result is OK…

Also I have even I have striped in routes.rb to (also let the default
content)

ActionController::Routing::Routes.draw do |map|
map.resources :posts
end

But the result is the same :

NameError in Posts#index

Showing posts/index.html.erb where line #22 raised:

undefined local variable or method `new_posts_path’ for
#ActionView::Base:0xb6f85f78

Extracted source (around line #22):

19:
20:

21:
22: <%= link_to ‘New posts’, new_posts_path %>

RAILS_ROOT: /media/desa/smartdsign/svn/catalogo
Application Trace | Framework Trace | Full Trace

app/views/posts/index.html.erb:22:in
_run_erb_47app47views47posts47index46html46erb' app/controllers/posts_controller.rb:7:inindex’

vendor/rails/actionpack/lib/action_view/base.rb:338:in send' vendor/rails/actionpack/lib/action_view/base.rb:338:inexecute’
vendor/rails/actionpack/lib/action_view/template_handlers/
compilable.rb:29:in send' vendor/rails/actionpack/lib/action_view/template_handlers/ compilable.rb:29:inrender’
vendor/rails/actionpack/lib/action_view/template.rb:35:in render' vendor/rails/actionpack/lib/action_view/template.rb:22:inrender_template’
vendor/rails/actionpack/lib/action_view/base.rb:245:in render_file' vendor/rails/actionpack/lib/action_controller/base.rb:1108:inrender_for_file’
vendor/rails/actionpack/lib/action_controller/base.rb:865:in
render_with_no_layout' vendor/rails/actionpack/lib/action_controller/base.rb:880:inrender_with_no_layout’
vendor/rails/actionpack/lib/action_controller/layout.rb:251:in
render_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:inrender’
vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:
8:in realtime' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:inrender’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:131:in
send' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:131:incustom’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:160:in
call' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:160:inrespond’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:154:in
each' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:154:inrespond’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:107:in
respond_to' vendor/rails/actionpack/lib/action_controller/base.rb:1162:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:1162:in
perform_action_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:580:incall_filters’
vendor/rails/actionpack/lib/action_controller/filters.rb:573:in
perform_action_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in
perform_action_without_caching' vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb: 13:inperform_action’
vendor/rails/activerecord/lib/active_record/connection_adapters/
abstract/query_cache.rb:33:in cache' vendor/rails/activerecord/lib/active_record/query_cache.rb:8:incache’
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:
12:in perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:529:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:529:in
process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:569:inprocess_without_session_management_support’
vendor/rails/actionpack/lib/action_controller/session_management.rb:
130:in process' vendor/rails/actionpack/lib/action_controller/base.rb:389:inprocess’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in
handle_request' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in
synchronize' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in
dispatch_cgi' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:indispatch’
vendor/rails/railties/lib/webrick_server.rb:112:in handle_dispatch' vendor/rails/railties/lib/webrick_server.rb:78: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’
vendor/rails/railties/lib/webrick_server.rb:62:in dispatch' vendor/rails/railties/lib/commands/servers/webrick.rb:66 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' vendor/rails/activesupport/lib/active_support/dependencies.rb:509:inrequire’
vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in
new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:509:inrequire’
vendor/rails/railties/lib/commands/server.rb:39
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire’
script/server:3

app/views/posts/index.html.erb:22:in
_run_erb_47app47views47posts47index46html46erb' vendor/rails/actionpack/lib/action_view/base.rb:338:insend’
vendor/rails/actionpack/lib/action_view/base.rb:338:in execute' vendor/rails/actionpack/lib/action_view/template_handlers/ compilable.rb:29:insend’
vendor/rails/actionpack/lib/action_view/template_handlers/
compilable.rb:29:in render' vendor/rails/actionpack/lib/action_view/template.rb:35:inrender’
vendor/rails/actionpack/lib/action_view/template.rb:22:in
render_template' vendor/rails/actionpack/lib/action_view/base.rb:245:inrender_file’
vendor/rails/actionpack/lib/action_controller/base.rb:1108:in
render_for_file' vendor/rails/actionpack/lib/action_controller/base.rb:865:inrender_with_no_layout’
vendor/rails/actionpack/lib/action_controller/base.rb:880:in
render_with_no_layout' vendor/rails/actionpack/lib/action_controller/layout.rb:251:inrender_without_benchmark’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in
render' vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb: 8:inrealtime’
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in
render' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:131:insend’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:131:in
custom' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:160:incall’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:160:in
respond' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:154:ineach’
vendor/rails/actionpack/lib/action_controller/mime_responds.rb:154:in
respond' vendor/rails/actionpack/lib/action_controller/mime_responds.rb:107:inrespond_to’
app/controllers/posts_controller.rb:7:in index' vendor/rails/actionpack/lib/action_controller/base.rb:1162:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:1162:in
perform_action_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:580:incall_filters’
vendor/rails/actionpack/lib/action_controller/filters.rb:573:in
perform_action_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in
perform_action_without_caching' vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb: 13:inperform_action’
vendor/rails/activerecord/lib/active_record/connection_adapters/
abstract/query_cache.rb:33:in cache' vendor/rails/activerecord/lib/active_record/query_cache.rb:8:incache’
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:
12:in perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:529:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:529:in
process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:569:inprocess_without_session_management_support’
vendor/rails/actionpack/lib/action_controller/session_management.rb:
130:in process' vendor/rails/actionpack/lib/action_controller/base.rb:389:inprocess’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in
handle_request' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in
synchronize' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:indispatch’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in
dispatch_cgi' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:indispatch’
vendor/rails/railties/lib/webrick_server.rb:112:in handle_dispatch' vendor/rails/railties/lib/webrick_server.rb:78: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’
vendor/rails/railties/lib/webrick_server.rb:62:in dispatch' vendor/rails/railties/lib/commands/servers/webrick.rb:66 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in require' vendor/rails/activesupport/lib/active_support/dependencies.rb:509:inrequire’
vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in
new_constants_in' vendor/rails/activesupport/lib/active_support/dependencies.rb:509:inrequire’
vendor/rails/railties/lib/commands/server.rb:39
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire’
script/server:3

Request

Parameters:

None

Show session dump


user_credentials:
6252a9019e849217cd459da20af7e44dfa55489e8b4c7483fd32cc7742be096203a3726b0af3f0dafa6b31fd10b5ceb4b3a71c98924dc7b2033cd7c4d613e87b
:csrf_id: c3d12be59f0a71df731b6ec9cb5eb4ae
flash: !map:ActionController::Flash::FlashHash {}

:return_to:
user_credentials_id: 1

Response

Headers:

{“Content-Type”=>“text/html”,
“cookie”=>[],
“Cache-Control”=>“no-cache”}

=============================================================

I dont know what is happening… I have been using the generators in
this project well, now they are failing?

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