繁体   English   中英

狂欢:Heroku上的ArgumentError(缺少必需的:bucket选项)

[英]Spree: ArgumentError (missing required :bucket option) on Heroku

我很难让Amazon s3和Heroku与Spree一起良好地工作。 每当我尝试上传图像时,都会收到此错误: ArgumentError (missing required :bucket option)

我不确定自己在做什么错,谢谢您的帮助。

Spree.rb

Spree.config do |config|
    attachment_config = {

      s3_credentials: {
        access_key_id:     ENV['AWS_ACCESS_KEY_ID'],
        secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
        bucket:            ENV['S3_BUCKET_NAME']
      },

      storage:        :s3,
      s3_headers:     { "Cache-Control" => "max-age=31557600" },
      s3_protocol:    "https",
      bucket:         ENV['S3_BUCKET_NAME'],
      url:            ":s3_domain_url",

      styles: {
          mini:     "48x48>",
          small:    "100x100>",
          product:  "240x240>",
          large:    "600x600>"
      },

      path:           "/:class/:id/:style/:basename.:extension",
      default_url:    "/:class/:id/:style/:basename.:extension",
      default_style:  "product"
    }

    attachment_config.each do |key, value|
      Spree::Image.attachment_definitions[:attachment][key.to_sym] = value
    end
end

Spree.user_class = "Spree::User"

heroku日志

2015-09-29T03:52:43.095532+00:00 app[web.1]: Command :: file -b --mime '/tmp/74f262efbb371339275f4ac4988d008220150929-3-b06f2w20150929-3-s4rw17'
2015-09-29T03:52:43.124567+00:00 app[web.1]:    (1.1ms)  BEGIN
2015-09-29T03:52:43.139844+00:00 app[web.1]:   Spree::Asset Load (1.1ms)  SELECT  "spree_assets".* FROM "spree_assets" WHERE (spree_assets.position IS NOT NULL) AND "spree_assets"."viewable_id" = $1 AND "spree_assets"."viewable_type" = $2  ORDER BY spree_assets.position DESC LIMIT 1  [["viewable_id", 1], ["viewable_type", "Spree::Variant"]]
2015-09-29T03:52:43.152510+00:00 app[web.1]:   Spree::Variant Load (1.3ms)  SELECT  "spree_variants".* FROM "spree_variants" WHERE "spree_variants"."deleted_at" IS NULL AND "spree_variants"."id" = $1 LIMIT 1  [["id", 1]]
2015-09-29T03:52:43.165804+00:00 app[web.1]:   Spree::Product Load (2.0ms)  SELECT  "spree_products".* FROM "spree_products" WHERE "spree_products"."id" = $1 LIMIT 1  [["id", 1]]
2015-09-29T03:52:43.176737+00:00 app[web.1]:   Spree::Taxon Load (1.9ms)  SELECT "spree_taxons".* FROM "spree_taxons" INNER JOIN "spree_products_taxons" ON "spree_taxons"."id" = "spree_products_taxons"."taxon_id" WHERE "spree_products_taxons"."product_id" = $1  [["product_id", 1]]
2015-09-29T03:52:43.184663+00:00 app[web.1]:   SQL (1.4ms)  UPDATE "spree_taxonomies" SET "updated_at" = '2015-09-29 03:52:43.179125' WHERE "spree_taxonomies"."id" IN (SELECT "spree_taxonomies"."id" FROM "spree_taxonomies" WHERE 1=0  ORDER BY spree_taxonomies.position, spree_taxonomies.created_at)
2015-09-29T03:52:42.960450+00:00 app[web.1]: Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/74f262efbb371339275f4ac4988d008220150929-3-b06f2w.png[0]' 2>/dev/null
2015-09-29T03:52:42.995241+00:00 app[web.1]: Command :: convert '/tmp/74f262efbb371339275f4ac4988d008220150929-3-b06f2w.png[0]' -auto-orient -resize "600x600>" -strip -auto-orient -colorspace sRGB '/tmp/74f262efbb371339275f4ac4988d008220150929-3-b06f2w20150929-3-s4rw17'
2015-09-29T03:52:43.100987+00:00 app[web.1]: Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/74f262efbb371339275f4ac4988d008220150929-3-b06f2w.png[0]' 2>/dev/null
2015-09-29T03:52:43.125718+00:00 app[web.1]: Command :: file -b --mime '/tmp/74f262efbb371339275f4ac4988d008220150929-3-1t46ljy.png'
2015-09-29T03:52:43.143777+00:00 app[web.1]:   SQL (1.2ms)  INSERT INTO "spree_assets" ("type", "viewable_type", "viewable_id", "attachment_file_name", "attachment_content_type", "attachment_file_size", "attachment_updated_at", "attachment_width", "attachment_height", "alt", "created_at", "updated_at", "position") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING "id"  [["type", "Spree::Image"], ["viewable_type", "Spree::Variant"], ["viewable_id", 1], ["attachment_file_name", "default-profile-pic.png"], ["attachment_content_type", "image/png"], ["attachment_file_size", 13648], ["attachment_updated_at", "2015-09-29 03:52:42.422226"], ["attachment_width", 400], ["attachment_height", 400], ["alt", ""], ["created_at", "2015-09-29 03:52:43.136153"], ["updated_at", "2015-09-29 03:52:43.136153"], ["position", 1]]
2015-09-29T03:52:43.161572+00:00 app[web.1]:   SQL (1.4ms)  UPDATE "spree_variants" SET "updated_at" = '2015-09-29 03:52:43.153272' WHERE "spree_variants"."id" = $1  [["id", 1]]
2015-09-29T03:52:43.169740+00:00 app[web.1]:   SQL (1.1ms)  UPDATE "spree_products" SET "updated_at" = '2015-09-29 03:52:43.166331' WHERE "spree_products"."id" = $1  [["id", 1]]
2015-09-29T03:52:43.178740+00:00 app[web.1]:   SQL (1.0ms)  UPDATE "spree_taxons" SET "updated_at" = '2015-09-29 03:52:43.177236' WHERE 1=0
2015-09-29T03:52:43.185643+00:00 app[web.1]: [paperclip] saving /spree/images/15/original/default-profile-pic.png
2015-09-29T03:52:43.249013+00:00 heroku[router]: at=info method=POST path="/admin/products/nintendo/images" host=shuabe-store.herokuapp.com request_id=d5fea436-8149-4cc6-a4a3-c61552f3bd4b fwd="104.230.226.189" dyno=web.1 connect=0ms service=931ms status=500 bytes=1669
2015-09-29T03:52:43.244220+00:00 app[web.1]: Completed 500 Internal Server Error in 871ms (ActiveRecord: 36.4ms)
2015-09-29T03:52:43.242853+00:00 app[web.1]:    (1.1ms)  ROLLBACK
2015-09-29T03:52:43.246449+00:00 app[web.1]: 
2015-09-29T03:52:43.246452+00:00 app[web.1]: ArgumentError (missing required :bucket option):
2015-09-29T03:52:43.246454+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.4/lib/paperclip/storage/s3.rb:218:in `bucket_name'
2015-09-29T03:52:43.246456+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.4/lib/paperclip/storage/s3.rb:251:in `s3_bucket'
2015-09-29T03:52:43.246458+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.4/lib/paperclip/storage/s3.rb:255:in `s3_object'
2015-09-29T03:52:43.246459+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.4/lib/paperclip/storage/s3.rb:360:in `block in flush_writes'
2015-09-29T03:52:43.246460+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.4/lib/paperclip/storage/s3.rb:331:in `each'
2015-09-29T03:52:43.246462+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.4/lib/paperclip/storage/s3.rb:331:in `flush_writes'
2015-09-29T03:52:43.246463+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.4/lib/paperclip/attachment.rb:238:in `save'
2015-09-29T03:52:43.246465+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/paperclip-4.2.4/lib/paperclip/has_attached_file.rb:91:in `block in add_active_record_callbacks'
2015-09-29T03:52:43.246467+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:444:in `instance_exec'
2015-09-29T03:52:43.246468+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:444:in `block in make_lambda'
2015-09-29T03:52:43.246470+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:226:in `call'
2015-09-29T03:52:43.246471+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:226:in `block in halting_and_conditional'
2015-09-29T03:52:43.246472+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:504:in `call'
2015-09-29T03:52:43.246474+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:504:in `block in call'
2015-09-29T03:52:43.246475+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:504:in `each'
2015-09-29T03:52:43.246478+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:504:in `call'
2015-09-29T03:52:43.246479+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:88:in `run_callbacks'
2015-09-29T03:52:43.246481+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/callbacks.rb:302:in `create_or_update'
2015-09-29T03:52:43.246482+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/persistence.rb:120:in `save'
2015-09-29T03:52:43.246483+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/validations.rb:37:in `save'
2015-09-29T03:52:43.246485+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/attribute_methods/dirty.rb:21:in `save'
2015-09-29T03:52:43.246486+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:286:in `block (2 levels) in save'
2015-09-29T03:52:43.246488+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_status'
2015-09-29T03:52:43.246489+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
2015-09-29T03:52:43.246491+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
2015-09-29T03:52:43.246493+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
2015-09-29T03:52:43.246494+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:220:in `transaction'
2015-09-29T03:52:43.246495+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
2015-09-29T03:52:43.246514+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:286:in `block in save'
2015-09-29T03:52:43.246516+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
2015-09-29T03:52:43.246517+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/transactions.rb:285:in `save'
2015-09-29T03:52:43.246518+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/bundler/gems/spree-c4f3907dd279/backend/app/controllers/spree/admin/resource_controller.rb:53:in `create'
2015-09-29T03:52:43.246520+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
2015-09-29T03:52:43.246521+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/abstract_controller/base.rb:198:in `process_action'
2015-09-29T03:52:43.246522+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/rendering.rb:10:in `process_action'
2015-09-29T03:52:43.246524+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
2015-09-29T03:52:43.246529+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:115:in `call'
2015-09-29T03:52:43.246531+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:115:in `call'
2015-09-29T03:52:43.246532+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:553:in `block (2 levels) in compile'
2015-09-29T03:52:43.246534+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:503:in `call'
2015-09-29T03:52:43.246535+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:503:in `call'
2015-09-29T03:52:43.246536+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:88:in `run_callbacks'
2015-09-29T03:52:43.246538+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/abstract_controller/callbacks.rb:19:in `process_action'
2015-09-29T03:52:43.246539+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/rescue.rb:29:in `process_action'
2015-09-29T03:52:43.246540+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
2015-09-29T03:52:43.246542+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/notifications.rb:164:in `block in instrument'
2015-09-29T03:52:43.246543+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2015-09-29T03:52:43.246544+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/notifications.rb:164:in `instrument'
2015-09-29T03:52:43.246546+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
2015-09-29T03:52:43.246547+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
2015-09-29T03:52:43.246548+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
2015-09-29T03:52:43.246549+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/abstract_controller/base.rb:137:in `process'
2015-09-29T03:52:43.246551+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionview-4.2.3/lib/action_view/rendering.rb:30:in `process'
2015-09-29T03:52:43.246552+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal.rb:196:in `dispatch'
2015-09-29T03:52:43.246553+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
2015-09-29T03:52:43.246554+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_controller/metal.rb:237:in `block in action'
2015-09-29T03:52:43.246555+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:76:in `call'
2015-09-29T03:52:43.246557+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
2015-09-29T03:52:43.246558+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:45:in `serve'
2015-09-29T03:52:43.246559+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:43:in `block in serve'
2015-09-29T03:52:43.246560+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:30:in `each'
2015-09-29T03:52:43.246561+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:30:in `serve'
2015-09-29T03:52:43.246563+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:821:in `call'
2015-09-29T03:52:43.246564+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:518:in `call'
2015-09-29T03:52:43.246565+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `public_send'
2015-09-29T03:52:43.246567+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `method_missing'
2015-09-29T03:52:43.246568+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/mapper.rb:51:in `serve'
2015-09-29T03:52:43.246569+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:43:in `block in serve'
2015-09-29T03:52:43.246570+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:30:in `each'
2015-09-29T03:52:43.246571+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/journey/router.rb:30:in `serve'
2015-09-29T03:52:43.246572+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/routing/route_set.rb:821:in `call'
2015-09-29T03:52:43.246574+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
2015-09-29T03:52:43.246575+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
2015-09-29T03:52:43.246577+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
2015-09-29T03:52:43.246578+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
2015-09-29T03:52:43.246579+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:38:in `call'
2015-09-29T03:52:43.246584+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
2015-09-29T03:52:43.246586+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2015-09-29T03:52:43.246587+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/flash.rb:260:in `call'
2015-09-29T03:52:43.246588+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
2015-09-29T03:52:43.246589+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
2015-09-29T03:52:43.246590+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/cookies.rb:560:in `call'
2015-09-29T03:52:43.246592+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/query_cache.rb:36:in `call'
2015-09-29T03:52:43.246593+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
2015-09-29T03:52:43.246594+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2015-09-29T03:52:43.246595+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/callbacks.rb:84:in `run_callbacks'
2015-09-29T03:52:43.246597+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2015-09-29T03:52:43.246598+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
2015-09-29T03:52:43.246599+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2015-09-29T03:52:43.246600+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2015-09-29T03:52:43.246602+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/rack/logger.rb:38:in `call_app'
2015-09-29T03:52:43.246603+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/rack/logger.rb:20:in `block in call'
2015-09-29T03:52:43.246604+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2015-09-29T03:52:43.246605+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/tagged_logging.rb:26:in `tagged'
2015-09-29T03:52:43.246606+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/tagged_logging.rb:68:in `tagged'
2015-09-29T03:52:43.246608+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/rack/logger.rb:20:in `call'
2015-09-29T03:52:43.246609+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2015-09-29T03:52:43.246610+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
2015-09-29T03:52:43.246611+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
2015-09-29T03:52:43.246612+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.3/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
2015-09-29T03:52:43.246613+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.3/lib/action_dispatch/middleware/static.rb:116:in `call'
2015-09-29T03:52:43.246615+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
2015-09-29T03:52:43.246616+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/engine.rb:518:in `call'
2015-09-29T03:52:43.246617+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.3/lib/rails/application.rb:165:in `call'
2015-09-29T03:52:43.246618+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-2.13.4/lib/puma/configuration.rb:78:in `call'
2015-09-29T03:52:43.246620+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-2.13.4/lib/puma/server.rb:541:in `handle_request'
2015-09-29T03:52:43.246621+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-2.13.4/lib/puma/server.rb:388:in `process_client'
2015-09-29T03:52:43.246622+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-2.13.4/lib/puma/server.rb:270:in `block in run'
2015-09-29T03:52:43.246623+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-2.13.4/lib/puma/thread_pool.rb:106:in `call'
2015-09-29T03:52:43.246624+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-2.13.4/lib/puma/thread_pool.rb:106:in `block in spawn_thread'
2015-09-29T03:52:43.246626+00:00 app[web.1]:

development.rb

Rails.application.configure do

  config.cache_classes = false 
  config.eager_load = false

  config.consider_all_requests_local       = true
  config.action_controller.perform_caching = false

  config.action_mailer.raise_delivery_errors = false
  config.active_support.deprecation = :log 
  config.active_record.migration_error = :page_load
  config.assets.debug = true

  config.assets.digest = true
  config.assets.raise_runtime_errors = true



config.paperclip_defaults = {
   :storage => :s3,
   :s3_credentials => {
     :bucket => ENV['S3_BUCKET_NAME'],
     :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
     :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
   }
 }

end

production.rb

Rails.application.configure do
  config.cache_classes = true
  config.eager_load = true
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?

  config.assets.js_compressor = :uglifier
  config.assets.compile = false 
  config.assets.digest = true
  config.log_level = :debug

  config.i18n.fallbacks = true
  config.active_support.deprecation = :notify
  config.log_formatter = ::Logger::Formatter.new
  config.active_record.dump_schema_after_migration = false



    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
    address:              'smtp.gmail.com',
    port:                 587,
    domain:               'gmail.com', 
    user_name:            ENV['EMAIL_ID'],
    password:             ENV['EMAIL_PASSWORD'],
    authentication:       'plain',
    enable_starttls_auto: true
    }

config.paperclip_defaults = {
   :storage => :s3,
   :s3_credentials => {
     :bucket => ENV['S3_BUCKET_NAME'],
     :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
     :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
   }
 }    

end

的Gemfile

source 'https://rubygems.org'

ruby "2.2.1"

gem 'aws-sdk', '< 2.0'
gem 'puma', '~> 2.13.4'
gem 'braintree', '~> 2.48.1'
gem 'rails', '4.2.3'
gem 'pg'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

group :development, :test do
  gem 'byebug'
  gem 'web-console', '~> 2.0'
  gem 'spring'
end

gem 'rails_12factor', group: :production


gem 'spree', github: 'spree/spree', branch: '3-0-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-0-stable'

做:

 heroku config 

检查heroku环境变量,并确保已设置S3_BUCKET_NAME

如果未设置,则应使用以下命令设置环境变量:

heroku config:add S3_BUCKET_NAME=your_bucket_name

有关配置和配置变量,请参见heroku参考。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM