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:inrun_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:insave' activerecord (3.1.1) lib/active_record/validations.rb:50:in
save'activerecord (3.1.1)lib / active_record / attribute_methods / dirty.rb:22:insave' activerecord (3.1.1) lib/active_record/transactions.rb:241:in
save' activerecord(3.1.1)lib / active_record / transactions.rb:295:inwith_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:intransaction' 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:insave' 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:inpopulate' spree_core (0.70.3) app/controllers/orders_controller.rb:47:in
每个'spree_core(0.70.3) app / controllers / orders_controller.rb:47:inpopulate' 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:inprocess_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:ininstrument' activesupport (3.1.1) lib/active_support/notifications/instrumenter.rb:21:in
仪器” activesupport(3.1.1)lib / active_support / notifications.rb:53:ininstrument' 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:inprocess_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:inaction' 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:incall' 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:incall' spree_core (0.70.3) lib/middleware/seo_assist.rb:23:in
catch'warden(1.0.6) lib / warden / manager.rb:34:incall' warden (1.0.6) lib/warden/manager.rb:34:in
call' rack(1.3.5)lib / rack / etag.rb:23:incall' 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:incall' rack (1.3.5) lib/rack/conditionalget.rb:35:in
call' actionpack(3.1.1)lib / action_dispatch / middleware / flash.rb:243:incall' actionpack (3.1.1) lib/action_dispatch/middleware/params_parser.rb:21:in
上下文” rack(1.3.5)lib / rack / session / abstract / id.rb:190:incall' rack (1.3.5) lib/rack/session/abstract/id.rb:195:in
call' activerecord(3.1.1)lib / active_record / query_cache.rb:62:incall' actionpack (3.1.1) lib/action_dispatch/middleware/cookies.rb:331:in
call'actionpack(3.1.1) lib / action_dispatch / middleware / callbacks.rb:29:incall' 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:incall' activesupport (3.1.1) lib/active_support/callbacks.rb:392:in
run_callbacks'actionpack(3.1.1) lib / action_dispatch / middleware / callbacks.rb:28:insend' 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:incall' actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in
call'rack(1.3.5) lib / rack / methodoverride.rb:24:incall' 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:incall' 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:incall' railties (3.1.1) lib/rails/engine.rb:456:in
call'rack(1.3.5) lib / rack / handler / webrick.rb:59:incall' railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in
service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:inservice' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in
start_thread' /usr/lib/ruby/1.8/webrick/server.rb:162:inrun' /usr/lib/ruby/1.8/webrick/server.rb:173:in
start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:instart' /usr/lib/ruby/1.8/webrick/server.rb:162:in
每个' /usr/lib/ruby/1.8/webrick/server.rb:92:instart' /usr/lib/ruby/1.8/webrick/server.rb:92:in
start' /usr/lib/ruby/1.8/webrick/server.rb:82:instart' /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:instart' railties (3.1.1) lib/rails/commands/server.rb:70:in
需要'script / rails:6
答案 0 :(得分:0)
Gemfile中的gem'mysql2'和bundle install工作......