OrdersController#中的NoMethodError填充Spree

时间:2011-12-17 17:44:03

标签: ruby-on-rails spree

NoMethodError in OrdersController#populate

undefined method `completed?' for nil:NilClass

点击结帐时获取上述错误...任何想法。

完整跟踪

  

activesupport(3.1.1)lib / active_support / whiny_nil.rb:48:in   method_missing' spree_core (0.70.3) app/models/line_item.rb:73:in update_inventory'activesupport(3.1.1)   lib / active_support / callbacks.rb:413:在_run_save_callbacks' activesupport (3.1.1) lib/active_support/callbacks.rb:81:in发送'   activesupport(3.1.1)lib / active_support / callbacks.rb:81:in   run_callbacks' activerecord (3.1.1) lib/active_record/callbacks.rb:264:in create_or_update'activerecord   (3.1.1)lib / active_record / persistence.rb:37:in save' activerecord (3.1.1) lib/active_record/validations.rb:50:in save'activerecord   (3.1.1)lib / active_record / attribute_methods / dirty.rb:22:in save' activerecord (3.1.1) lib/active_record/transactions.rb:241:in save'   activerecord(3.1.1)lib / active_record / transactions.rb:295:in   with_transaction_returning_status' activerecord (3.1.1) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in 交易'activerecord(3.1.1)   lib / active_record / transactions.rb:208:in transaction' activerecord (3.1.1) lib/active_record/transactions.rb:293:in with_transaction_returning_status'activerecord(3.1.1)   lib / active_record / transactions.rb:241:in save' activerecord (3.1.1) lib/active_record/transactions.rb:252:in rollback_active_record_state!' activerecord(3.1.1)   lib / active_record / transactions.rb:240:在save' activerecord (3.1.1) lib/active_record/associations/has_many_association.rb:16:in insert_record'activerecord(3.1.1)中   LIB / active_record /协会/ collection_association.rb:128:在   concat' activerecord (3.1.1) lib/active_record/associations/collection_association.rb:337:in add_to_target'activerecord(3.1.1)   LIB / active_record /协会/ collection_association.rb:127:在   concat' activerecord (3.1.1) lib/active_record/associations/collection_association.rb:125:in每个”   activerecord(3.1.1)   LIB / active_record /协会/ collection_association.rb:125:在   concat' activerecord (3.1.1) lib/active_record/associations/collection_association.rb:147:in 交易'activerecord(3.1.1)   LIB / active_record / connection_adapters /抽象/ database_statements.rb:192:在   transaction' activerecord (3.1.1) lib/active_record/transactions.rb:208:in交易'activerecord   (3.1.1)   LIB / active_record /协会/ collection_association.rb:146:在   transaction' activerecord (3.1.1) lib/active_record/associations/collection_association.rb:124:in concat'activerecord(3.1.1)   lib / active_record / associations / collection_proxy.rb:118:in <<' spree_core (0.70.3) app/models/order.rb:216:in add_variant'   spree_core(0.70.3)app / controllers / orders_controller.rb:49:in   populate' spree_core (0.70.3) app/controllers/orders_controller.rb:47:in每个'spree_core(0.70.3)   app / controllers / orders_controller.rb:47:in populate' actionpack (3.1.1) lib/action_controller/metal/implicit_render.rb:4:in send_action'actionpack(3.1.1)   lib / action_controller / metal / implicit_render.rb:4:在send_action' actionpack (3.1.1) lib/abstract_controller/base.rb:167:in process_action'actionpack(3.1.1)中   lib / action_controller / metal / rendering.rb:10:在process_action' actionpack (3.1.1) lib/abstract_controller/callbacks.rb:18:in process_action'activesupport(3.1.1)中   LIB / active_support / callbacks.rb:452:在   _run__1106774758__process_action__1039901831__callbacks' activesupport (3.1.1) lib/active_support/callbacks.rb:386:in发送”   activesupport(3.1.1)lib / active_support / callbacks.rb:386:in   _run_process_action_callbacks' activesupport (3.1.1) lib/active_support/callbacks.rb:81:in发送'activesupport(3.1.1)   lib / active_support / callbacks.rb:81:在run_callbacks' actionpack (3.1.1) lib/abstract_controller/callbacks.rb:17:in process_action'中   actionpack(3.1.1)lib / action_controller / metal / rescue.rb:17:in   process_action' actionpack (3.1.1) lib/action_controller/metal/instrumentation.rb:30:in process_action”   activesupport(3.1.1)lib / active_support / notifications.rb:53:in   instrument' activesupport (3.1.1) lib/active_support/notifications/instrumenter.rb:21:in仪器”   activesupport(3.1.1)lib / active_support / notifications.rb:53:in   instrument' actionpack (3.1.1) lib/action_controller/metal/instrumentation.rb:29:in process_action”   actionpack(3.1.1)   lib / action_controller / metal / params_wrapper.rb:201:in process_action' activerecord (3.1.1) lib/active_record/railties/controller_runtime.rb:18:in process_action'actionpack(3.1.1)   lib / abstract_controller / base.rb:121:在process' actionpack (3.1.1) lib/abstract_controller/rendering.rb:45:in进程'actionpack中   (3.1.1)lib / action_controller / metal.rb:193:在dispatch' actionpack (3.1.1) lib/action_controller/metal/rack_delegation.rb:14:in dispatch'actionpack(3.1.1)lib / action_controller / metal.rb:236:in   action' actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:65:in调用'actionpack   (3.1.1)lib / action_dispatch / routing / route_set.rb:65:在dispatch' actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:29:in 调用'rack-mount(0.8.3)lib / rack / mount / route_set.rb:152:在{{1} }认识'   rack-mount(0.8.3)lib / rack / mount / code_generation.rb:75:in   call' rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in识别'机架式安装(0.8.3)   lib / rack / mount / route_set.rb:141:在optimized_each' rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in调用'spree_core   (0.70.3)lib / redirect_legacy_product_url.rb:10:在call' actionpack (3.1.1) lib/action_dispatch/routing/route_set.rb:532:in调用'warden(1.0.6)   lib / warden / manager.rb:35:in call' spree_core (0.70.3) lib/middleware/seo_assist.rb:23:in catch'warden(1.0.6)   lib / warden / manager.rb:34:in call' warden (1.0.6) lib/warden/manager.rb:34:in call'   rack(1.3.5)lib / rack / etag.rb:23:in call' actionpack (3.1.1) lib/action_dispatch/middleware/best_standards_support.rb:17:in call'actionpack(3.1.1)   lib / action_dispatch / middleware / head.rb:14:in call' rack (1.3.5) lib/rack/conditionalget.rb:35:in call'   actionpack(3.1.1)lib / action_dispatch / middleware / flash.rb:243:in   call' actionpack (3.1.1) lib/action_dispatch/middleware/params_parser.rb:21:in上下文”   rack(1.3.5)lib / rack / session / abstract / id.rb:190:in call' rack (1.3.5) lib/rack/session/abstract/id.rb:195:in call'   activerecord(3.1.1)lib / active_record / query_cache.rb:62:in call' actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in call'actionpack(3.1.1)   lib / action_dispatch / middleware / callbacks.rb:29:in call' activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in _ run_call_callbacks'   activesupport(3.1.1)lib / active_support / callbacks.rb:81:in call' activesupport (3.1.1) lib/active_support/callbacks.rb:392:in run_callbacks'actionpack(3.1.1)   lib / action_dispatch / middleware / callbacks.rb:28:in send' activesupport (3.1.1) lib/active_support/callbacks.rb:81:in call'rack   (1.3.5)lib / rack / sendfile.rb:101:在call' actionpack (3.1.1) lib/action_dispatch/middleware/reloader.rb:68:in调用'actionpack   (3.1.1)lib / action_dispatch / middleware / show_exceptions.rb:47:in call' actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in call'rack(1.3.5)   lib / rack / methodoverride.rb:24:in call' railties (3.1.1) lib/rails/rack/logger.rb:13:in call'activesupport(3.1.1)   lib / active_support / cache / strategy / local_cache.rb:72:in call' rack (1.3.5) lib/rack/runtime.rb:17:in call'actionpack(3.1.1)   lib / action_dispatch / middleware / static.rb:53:在call' rack (1.3.5) lib/rack/lock.rb:15:in调用'railties(3.1.1)   lib / rails / rack / content_length.rb:16:in call' railties (3.1.1) lib/rails/engine.rb:456:in call'rack(1.3.5)   lib / rack / handler / webrick.rb:59:in call' railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in service'   /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in start_thread'   /usr/lib/ruby/1.8/webrick/server.rb:162:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:in start_thread'   /usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:in每个'   /usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:in start'   /usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:in运行'机架(1.3.5)   lib / rack / server.rb:265:在start' rack (1.3.5) lib/rack/handler/webrick.rb:13:in start'ravties(3.1.1)   lib / rails / commands.rb:54 railties(3.1.1)lib / rails / commands.rb:49:in   start' railties (3.1.1) lib/rails/commands/server.rb:70:in需要'script / rails:6

1 个答案:

答案 0 :(得分:0)

Gemfile中的gem'mysql2'和bundle install工作......