我获得了一个传统的狂欢应用程序,我应该编辑一个更深入的结帐页面,但我无法在我的本地进行,因为它一直将我重定向到带闪存的购物车页面:
Can't check out, no payment methods are configured for this environment
我的数据库应该与生产数据库相同。我在项目的任何地方都找不到Can't check out, no payment methods are configured for this environment
。我怎么能超过这个?
我检查了日志,看起来有一个before_filter阻止我通过:Filter chain halted as [:ensure_payment_methods] rendered_or_redirected.
。但是,我无法在代码中的任何位置找到此方法。如何编辑项目中不存在的控制器?我怎么知道它们在哪里?
这是我的日志:
Processing CheckoutsController#edit (for 127.0.0.1 at 2013-09-20 10:26:15) [GET]
Parameters: {"action"=>"edit", "controller"=>"checkouts", "order_id"=>"R838445544"}
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Order Load (0.6ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Cache hit: Spree::Config ({})
Zone Load (0.3ms) SELECT * FROM "zones" WHERE ("zones"."name" IS NULL) LIMIT 1
Country Load (0.8ms) SELECT * FROM "countries"
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Checkout Load (0.7ms) SELECT * FROM "checkouts" WHERE ("checkouts".order_id = 4744) LIMIT 1
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Cache hit: Spree::Config ({})
Country Load (0.2ms) SELECT * FROM "countries" WHERE ("countries"."id" = 214)
Cache hit: Spree::Config ({})
CACHE (0.0ms) SELECT * FROM "countries" WHERE ("countries"."id" = 214)
State Load (0.4ms) SELECT * FROM "states" WHERE ("states".country_id = 214)
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Redirected to http://localhost:3000/boutique/orders/R838445544/checkout/register
Filter chain halted as [:enforce_registration] rendered_or_redirected.
Completed in 77ms (DB: 5) | 302 Found [http://localhost/boutique/orders/R838445544/checkout/edit]
Property Load (0.3ms) SELECT * FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1
AppConfiguration Load (0.4ms) SELECT * FROM "configurations" WHERE ("configurations"."name" = 'Default configuration') AND ( ("configurations"."type" = 'AppConfiguration' ) ) LIMIT 1
Cache hit: Spree::Config ({})
requiring dependency
finished requiring.
SQL (0.1ms) SET client_min_messages TO 'panic'
SQL (0.1ms) SET standard_conforming_strings = on
SQL (0.1ms) SET client_min_messages TO 'notice'
User Load IDs For Limited Eager Loading (1.3ms) SELECT DISTINCT "users".id FROM "users" LEFT OUTER JOIN "roles_users" ON "roles_users".user_id = "users".id LEFT OUTER JOIN "roles" ON "roles".id = "roles_users".role_id WHERE (roles.name = 'admin') LIMIT 1
User Load Including Associations (0.8ms) SELECT "users"."id" AS t0_r0, "users"."email" AS t0_r1, "users"."crypted_password" AS t0_r2, "users"."salt" AS t0_r3, "users"."remember_token" AS t0_r4, "users"."remember_token_expires_at" AS t0_r5, "users"."created_at" AS t0_r6, "users"."updated_at" AS t0_r7, "users"."persistence_token" AS t0_r8, "users"."single_access_token" AS t0_r9, "users"."perishable_token" AS t0_r10, "users"."login_count" AS t0_r11, "users"."failed_login_count" AS t0_r12, "users"."last_request_at" AS t0_r13, "users"."current_login_at" AS t0_r14, "users"."last_login_at" AS t0_r15, "users"."current_login_ip" AS t0_r16, "users"."last_login_ip" AS t0_r17, "users"."login" AS t0_r18, "users"."ship_address_id" AS t0_r19, "users"."bill_address_id" AS t0_r20, "users"."openid_identifier" AS t0_r21, "users"."api_key" AS t0_r22, "users"."creditcard_id" AS t0_r23, "roles"."id" AS t1_r0, "roles"."name" AS t1_r1 FROM "users" LEFT OUTER JOIN "roles_users" ON "roles_users".user_id = "users".id LEFT OUTER JOIN "roles" ON "roles".id = "roles_users".role_id WHERE (roles.name = 'admin') AND "users".id IN (1)
Processing CheckoutsController#register (for 127.0.0.1 at 2013-09-20 10:26:17) [GET]
Parameters: {"action"=>"register", "controller"=>"checkouts", "order_id"=>"R838445544"}
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Order Load (0.5ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Cache hit: Spree::Config ({})
Zone Load (0.2ms) SELECT * FROM "zones" WHERE ("zones"."name" IS NULL) LIMIT 1
Country Load (0.7ms) SELECT * FROM "countries"
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Checkout Load (0.6ms) SELECT * FROM "checkouts" WHERE ("checkouts".order_id = 4744) LIMIT 1
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Cache hit: Spree::Config ({})
Country Load (0.2ms) SELECT * FROM "countries" WHERE ("countries"."id" = 214)
Cache hit: Spree::Config ({})
CACHE (0.0ms) SELECT * FROM "countries" WHERE ("countries"."id" = 214)
State Load (0.4ms) SELECT * FROM "states" WHERE ("states".country_id = 214)
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
PaymentMethod Load (0.4ms) SELECT * FROM "payment_methods" WHERE ("payment_methods"."deleted_at" IS NULL)
Redirected to http://localhost:3000/boutique/orders/R838445544/edit
Filter chain halted as [:ensure_payment_methods] rendered_or_redirected.
Completed in 83ms (DB: 5) | 302 Found [http://localhost/boutique/orders/R838445544/checkout/register]
Property Load (0.3ms) SELECT * FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1
AppConfiguration Load (0.3ms) SELECT * FROM "configurations" WHERE ("configurations"."name" = 'Default configuration') AND ( ("configurations"."type" = 'AppConfiguration' ) ) LIMIT 1
Cache hit: Spree::Config ({})
requiring dependency
finished requiring.
SQL (0.1ms) SET client_min_messages TO 'panic'
SQL (0.1ms) SET standard_conforming_strings = on
SQL (0.1ms) SET client_min_messages TO 'notice'
User Load IDs For Limited Eager Loading (1.3ms) SELECT DISTINCT "users".id FROM "users" LEFT OUTER JOIN "roles_users" ON "roles_users".user_id = "users".id LEFT OUTER JOIN "roles" ON "roles".id = "roles_users".role_id WHERE (roles.name = 'admin') LIMIT 1
User Load Including Associations (0.8ms) SELECT "users"."id" AS t0_r0, "users"."email" AS t0_r1, "users"."crypted_password" AS t0_r2, "users"."salt" AS t0_r3, "users"."remember_token" AS t0_r4, "users"."remember_token_expires_at" AS t0_r5, "users"."created_at" AS t0_r6, "users"."updated_at" AS t0_r7, "users"."persistence_token" AS t0_r8, "users"."single_access_token" AS t0_r9, "users"."perishable_token" AS t0_r10, "users"."login_count" AS t0_r11, "users"."failed_login_count" AS t0_r12, "users"."last_request_at" AS t0_r13, "users"."current_login_at" AS t0_r14, "users"."last_login_at" AS t0_r15, "users"."current_login_ip" AS t0_r16, "users"."last_login_ip" AS t0_r17, "users"."login" AS t0_r18, "users"."ship_address_id" AS t0_r19, "users"."bill_address_id" AS t0_r20, "users"."openid_identifier" AS t0_r21, "users"."api_key" AS t0_r22, "users"."creditcard_id" AS t0_r23, "roles"."id" AS t1_r0, "roles"."name" AS t1_r1 FROM "users" LEFT OUTER JOIN "roles_users" ON "roles_users".user_id = "users".id LEFT OUTER JOIN "roles" ON "roles".id = "roles_users".role_id WHERE (roles.name = 'admin') AND "users".id IN (1)
Processing OrdersController#edit (for 127.0.0.1 at 2013-09-20 10:26:19) [GET]
Parameters: {"action"=>"edit", "controller"=>"orders", "id"=>"R838445544"}
Order Load (0.5ms) SELECT * FROM "orders" WHERE ("orders"."number" = 'R838445544') LIMIT 1
Adjustment Load (0.4ms) SELECT "adjustments".* FROM "adjustments" WHERE ("adjustments".order_id = 4744) ORDER BY position
Cache hit: Spree::Config ({})
Checkout Load (0.6ms) SELECT * FROM "checkouts" WHERE ("checkouts".order_id = 4744) LIMIT 1
SQL (0.1ms) BEGIN
Order Load (0.2ms) SELECT * FROM "orders" WHERE ("orders"."id" = 4744)
Shipment Load (1.8ms) SELECT * FROM "shipments" WHERE ("shipments".order_id = 4744) ORDER BY shipments.id DESC LIMIT 1
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."id" = 4744)
SQL (0.1ms) COMMIT
SQL (0.1ms) BEGIN
LineItem Load (0.4ms) SELECT * FROM "line_items" WHERE ("line_items".order_id = 4744)
Variant Load (0.5ms) SELECT * FROM "variants" WHERE ("variants"."id" = 179)
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."id" = 4744)
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
InventoryUnit Load (0.5ms) SELECT * FROM "inventory_units" WHERE (inventory_units.order_id = 4744) LIMIT 1
Cache hit: Spree::Config ({})
Shipment Load (1.0ms) SELECT * FROM "shipments" WHERE ("shipments".order_id = 4744)
Charge Load (0.3ms) SELECT * FROM "adjustments" WHERE ("adjustments".order_id = 4744) AND ( ("adjustments"."type" = 'Charge' OR "adjustments"."type" = 'TaxCharge' OR "adjustments"."type" = 'ShippingCharge' ) ) ORDER BY position
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."id" = 4744)
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."id" = 4744)
CACHE (0.0ms) SELECT * FROM "shipments" WHERE ("shipments".order_id = 4744) ORDER BY shipments.id DESC LIMIT 1
Cache hit: Spree::Config ({})
Credit Load (0.2ms) SELECT * FROM "adjustments" WHERE ("adjustments".order_id = 4744) AND ( ("adjustments"."type" = 'Credit' OR "adjustments"."type" = 'GiftCardCredit' OR "adjustments"."type" = 'CouponCredit' OR "adjustments"."type" = 'ManagersDiscountCredit' OR "adjustments"."type" = 'ReturnAuthorizationCredit' ) ) ORDER BY position
SQL (0.1ms) COMMIT
Rendering template within layouts/spree_application
Rendering orders/edit
Image Load (0.6ms) SELECT * FROM "assets" WHERE ("assets".viewable_id = 179 AND "assets".viewable_type = 'Variant') AND ( ("assets"."type" = 'Image' OR "assets"."type" = 'ProductThumbnail' OR "assets"."type" = 'ProductPageImage' ) ) ORDER BY position
Product Load (0.7ms) SELECT * FROM "products" WHERE ("products"."id" = 85)
SQL (0.5ms) SELECT count(*) AS count_all FROM "assets" WHERE ("assets".viewable_id = 85 AND "assets".viewable_type = 'Product') AND ( ("assets"."type" = 'Image' OR "assets"."type" = 'ProductThumbnail' OR "assets"."type" = 'ProductPageImage' ) )
Image Load (0.3ms) SELECT * FROM "assets" WHERE ("assets".viewable_id = 85 AND "assets".viewable_type = 'Product') AND ( ("assets"."type" = 'Image' OR "assets"."type" = 'ProductThumbnail' OR "assets"."type" = 'ProductPageImage' ) ) ORDER BY position LIMIT 1
Cache hit: Spree::Config ({})
OptionValue Load (0.7ms) SELECT * FROM "option_values" INNER JOIN "option_values_variants" ON "option_values".id = "option_values_variants".option_value_id WHERE ("option_values_variants".variant_id = 179 )
OptionType Load (0.3ms) SELECT * FROM "option_types" WHERE ("option_types"."id" = 1)
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Rendered orders/_line_item (195.9ms)
Cache hit: Spree::Config ({})
Cache hit: Spree::Config ({})
Rendered orders/_form (201.2ms)
Rendered orders/_delivery (0.9ms)
Taxonomy Load (0.6ms) SELECT * FROM "taxonomies" WHERE (name != 'Featured Products') ORDER BY id
Taxon Load (0.7ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons".taxonomy_id IN (1,5,6,7,8) AND (parent_id is null))
Taxon Load (0.3ms) SELECT "taxons".* FROM "taxons" WHERE ("taxons".parent_id IN (1,33,34,35,37)) ORDER BY "lft"
Rendered shared/_taxonomies (25.5ms)
Cache hit: Spree::Config ({})
Rendered shared/_head (2.7ms)
Rendered shared/_store_menu (0.7ms)
Order Load (0.3ms) SELECT * FROM "orders" WHERE ("orders"."id" = 4744) LIMIT 1
CACHE (0.0ms) SELECT * FROM "orders" WHERE ("orders"."id" = 4744) LIMIT 1
CACHE (0.0ms) SELECT * FROM "line_items" WHERE ("line_items".order_id = 4744)
Rendered shared/_nav_bar (3.5ms)
Taxon Load (0.2ms) SELECT * FROM "taxons" WHERE ("taxons"."permalink" = 'caviar/') LIMIT 1
**@selected_tab is nil
Tracker Load (0.4ms) SELECT * FROM "trackers" WHERE ("trackers"."active" = 't' AND "trackers"."environment" = 'development') LIMIT 1
Rendered shared/_google_analytics (14.7ms)
Rendered shared/_footer (23.6ms)
Completed in 400ms (View: 295, DB: 15) | 200 OK [http://localhost/boutique/orders/R838445544/edit]
Property Load (0.3ms) SELECT * FROM "properties" WHERE ("properties"."name" = 'brand') LIMIT 1
AppConfiguration Load (0.4ms) SELECT * FROM "configurations" WHERE ("configurations"."name" = 'Default configuration') AND ( ("configurations"."type" = 'AppConfiguration' ) ) LIMIT 1
Cache hit: Spree::Config ({})
requiring dependency
finished requiring.
答案 0 :(得分:0)
如果查看spree_payment_methods
表,您会看到一个名为environment
的列。很可能您在'development'
列中没有environment
值的任何行。
导航至 / admin
创建付款方式,这应该可以解决您的问题。
一般情况下,您希望克隆Spree的本地副本或Gemfile中的任何Spree扩展,并使用grep来查找您需要的内容。