我最近将我的Rails网络应用程序从3.0.3升级到3.0.10。并获得错误的参数数量(1为0)错误。我想我会抛出一个“冰雹玛丽”通行证,并希望升级到Rails 3.2.8会让事情变得更好。不! : - )
我很难过会导致这种情况,我是新手而且无法破译堆栈跟踪。这是我的堆栈跟踪。我很感激一些帮助。
我从我的主人那里分支出来,所以我总是可以从头开始,但到目前为止,我已经尝试了两次同样的结果。
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `display'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `send_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `process_action'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:403:in `_run__1653335973__process_action__374356064__callbacks'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `send'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `send'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
vendor/ruby/1.8/gems/cells-3.8.6/lib/cell/rendering.rb:7:in `render_state'
vendor/ruby/1.8/gems/cells-3.8.6/lib/cell/caching.rb:83:in `render_state'
vendor/ruby/1.8/gems/cells-3.8.6/lib/cell/rendering.rb:105:in `render_cell_state'
vendor/ruby/1.8/gems/cells-3.8.6/lib/cell/rack.rb:27:in `render_cell_state'
vendor/ruby/1.8/gems/cells-3.8.6/lib/cell/rendering.rb:100:in `render_cell_for'
vendor/ruby/1.8/gems/cells-3.8.6/lib/cells/rails.rb:53:in `render_cell'
app/views/home/index.html.erb:1:in `_app_views_home_index_html_erb__617638568_2260825620'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/template.rb:145:in `send'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/template.rb:145:in `render'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/notifications.rb:125:in `instrument'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/template.rb:143:in `render'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:47:in `render_template'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:46:in `render_template'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:54:in `render_with_layout'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:45:in `render_template'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/template_renderer.rb:18:in `render'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:36:in `render_template'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:17:in `render'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:110:in `_render_template'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/streaming.rb:225:in `_render_template'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:103:in `render_to_body'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:88:in `render'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:16:in `render'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in `render'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/core_ext/benchmark.rb:5:in `ms'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:40:in `render'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
vendor/ruby/1.8/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:39:in `render'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:167:in `process_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/rendering.rb:10:in `process_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:18:in `process_action'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:414:in `_run__1183885179__process_action__918435846__callbacks'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `send'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `send'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/callbacks.rb:17:in `process_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/rescue.rb:29:in `process_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
vendor/ruby/1.8/gems/activerecord-3.2.8/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/base.rb:121:in `process'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/abstract_controller/rendering.rb:45:in `process'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal.rb:203:in `dispatch'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_controller/metal.rb:246:in `action'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:36:in `call'
vendor/ruby/1.8/gems/journey-1.0.4/lib/journey/router.rb:68:in `call'
vendor/ruby/1.8/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
vendor/ruby/1.8/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:600:in `call'
vendor/ruby/1.8/gems/warden-1.2.1/lib/warden/manager.rb:35:in `call'
vendor/ruby/1.8/gems/warden-1.2.1/lib/warden/manager.rb:34:in `catch'
vendor/ruby/1.8/gems/warden-1.2.1/lib/warden/manager.rb:34:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/head.rb:14:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/flash.rb:242:in `call'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/cookies.rb:339:in `call'
vendor/ruby/1.8/gems/activerecord-3.2.8/lib/active_record/query_cache.rb:64:in `call'
vendor/ruby/1.8/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `_run__1199251717__call__4__callbacks'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `send'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `send'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/reloader.rb:65:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/rack/logger.rb:26:in `call_app'
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/rack/logger.rb:16:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/request_id.rb:22:in `call'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
vendor/ruby/1.8/gems/activesupport-3.2.8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
vendor/ruby/1.8/gems/actionpack-3.2.8/lib/action_dispatch/middleware/static.rb:62:in `call'
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/engine.rb:479:in `call'
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/application.rb:223:in `call'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/rack/log_tailer.rb:17:in `call'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:13:in `run'
vendor/ruby/1.8/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/commands/server.rb:70:in `start'
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/commands.rb:55
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
vendor/ruby/1.8/gems/railties-3.2.8/lib/rails/commands.rb:50
script/rails:6:in `require'
script/rails:6
以下是整个错误消息:
答案 0 :(得分:2)
此问题已关闭。答案是Cell控制器方法需要传递参数。
在我的单元格控制器中,我应该有一个方法,如:
def display(quote)
@quote = Quote.first
render
end
而我所拥有的(并在ruby 1.8.7和rails 3.0.3下工作)是:
def display
@quote = Quote.first
render
end
我的错误关闭!特别感谢Nick Sutterer,他耐心地帮我解决了这个新手bug!