使用carrierwave将mp3文件上传到aws存储桶时出错

时间:2015-07-18 18:45:45

标签: ruby-on-rails ruby amazon-s3 carrierwave

我正在尝试使用aws bucket gem将mp3文件上传到carrierwave。我得到了断管异常。这是完整的痕迹

Broken pipe (Errno::EPIPE)
/Users/datt/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/openssl/buffering.rb:376:in `syswrite_nonblock'
/Users/datt/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/openssl/buffering.rb:376:in `write_nonblock'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/socket.rb:243:in `block in write_nonblock'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/socket.rb:238:in `loop'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/socket.rb:238:in `write_nonblock'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/socket.rb:78:in `write'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/connection.rb:152:in `request_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/mock.rb:47:in `request_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:15:in `request_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:15:in `request_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:15:in `request_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/connection.rb:233:in `request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/idempotent.rb:26:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/connection.rb:256:in `rescue in request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/connection.rb:204:in `request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/idempotent.rb:26:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/connection.rb:256:in `rescue in request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/connection.rb:204:in `request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/idempotent.rb:26:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/middlewares/base.rb:10:in `error_call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/connection.rb:256:in `rescue in request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/excon-0.45.3/lib/excon/connection.rb:204:in `request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/fog-core-1.30.0/lib/fog/core/connection.rb:81:in `request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/fog-xml-0.1.2/lib/fog/xml/connection.rb:9:in `request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/fog-aws-0.1.2/lib/fog/aws/storage.rb:593:in `_request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/fog-aws-0.1.2/lib/fog/aws/storage.rb:588:in `request'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/fog-aws-0.1.2/lib/fog/aws/requests/storage/put_object.rb:43:in `put_object'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/fog-aws-0.1.2/lib/fog/aws/models/storage/file.rb:212:in `save'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/fog-core-1.30.0/lib/fog/core/collection.rb:51:in `create'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:261:in `store'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:80:in `store!'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:59:in `block in store!'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/carrierwave-0.10.0/lib/carrierwave/uploader/callbacks.rb:17:in `with_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:58:in `store!'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:375:in `store!'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb:207:in `store_file_url!'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:225:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:225:in `block in halting_and_conditional'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:219:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:219:in `block in halting_and_conditional'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `_run_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_save_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/callbacks.rb:302:in `create_or_update'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/persistence.rb:120:in `save'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/validations.rb:37:in `save'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/attribute_methods/dirty.rb:21:in `save'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/transactions.rb:286:in `block (2 levels) in save'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/transactions.rb:347:in `block in with_transaction_returning_status'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/transactions.rb:220:in `transaction'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/transactions.rb:344:in `with_transaction_returning_status'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/transactions.rb:286:in `block in save'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/transactions.rb:301:in `rollback_active_record_state!'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/transactions.rb:285:in `save'
/Users/datt/projects/ruby/yogurt/Yolo/app/controllers/sound_tracks_controller.rb:59:in `upload'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:198:in `process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal/rendering.rb:10:in `process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `_run_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_process_action_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:19:in `process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal/rescue.rb:29:in `process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:137:in `process'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionview-4.2.0/lib/action_view/rendering.rb:30:in `process'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal.rb:195:in `dispatch'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_controller/metal.rb:236:in `block in action'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:42:in `serve'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `each'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `serve'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:802:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/etag.rb:24:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/conditionalget.rb:38:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/head.rb:13:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/flash.rb:260:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/session/abstract/id.rb:225:in `context'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/session/abstract/id.rb:220:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:36:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.2.0/lib/active_record/migration.rb:378:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `_run_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/reloader.rb:73:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in `call_app'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `block in call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:26:in `tagged'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `tagged'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/methodoverride.rb:22:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/runtime.rb:18:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/lock.rb:17:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/actionpack-4.2.0/lib/action_dispatch/middleware/static.rb:113:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/lock.rb:17:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/content_length.rb:15:in `call'
/Users/datt/.rvm/gems/ruby-2.0.0-p643/gems/rack-1.6.0/lib/rack/handler/webrick.rb:89:in `service'
/Users/datt/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/datt/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/datt/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Completed 422 Unprocessable Entity in 26996ms (Views: 0.5ms | ActiveRecord: 39.7ms)

1 个答案:

答案 0 :(得分:0)

我发现了问题。 aws s3的Carrierwave配置不合适。