【发布时间】:2013-11-07 11:57:52
【问题描述】:
我尝试设置 Amazon S3 支持,以使用refinerycms 将图像存储在云中。
我在https://console.aws.amazon.com/s3/创建了存储桶
我将它命名为应用程序“bee-barcelona”,它说它在美国标准地区
在~/config/initializers/refinery/images.rb 中我输入了所有数据(其中 'xxx? 代表我输入的实际键:
# Configure S3 (you can also use ENV for this)
# The s3_backend setting by default defers to the core setting for this but can be set just for images.
config.s3_backend = Refinery::Core.s3_backend
config.s3_bucket_name = ENV['bee-barcelona']
config.s3_access_key_id = ENV['xxx']
config.s3_secret_access_key = ENV['xxx']
config.s3_region = ENV['xxx']
然后我将更改应用到heroku:
heroku config:add S3_KEY=xxx S3_SECRET=xxx S3_BUCKET=bee-barcelona S3_REGION=us-standard
但是,当我尝试上传时,在应用程序中我只得到:“抱歉,出了点问题”。
我错过了什么?
【问题讨论】:
-
你的日志说问题是什么?
heroku logs. -
类似:vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in
service' 2013-11-07T12:41:34.741812+00:00 app[web.1]: Completed 500 Internal Server Error in 649.0ms 2013-11-07T12:41:34.740641+00:00 app[web.1]: vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:inblock in start_thread' 2013-11-07T12:41 :34.740641+00:00 应用[web.1]: 2013-11-07T12:41:34.740641+00:00 应用[web.1]: 2013-11-07T12:41:34.741812+00:00 应用[web.1] 1]: Refinery::Admin::ImagesController#create as HTML 处理 -
和:参数:{"utf8"=>"✓", "authenticity_token"=>"+UXRXJ13sDHK+T/put7sEWzEPoy/sGddfUxY+dgMkRE=", "image"=>{"image" =>[#<:http::uploadedfile:0x007f96681f7e20 form-data name='\"image[' image filename='\"Bee_Barcelona.jpg\"\r\nContent-Type:'>>] }, "wymeditor"=>"", "modal"=>"true", "dialog"=>"true", "app_dialog"=>"true", "field"=>"", "update_image"=> "", "缩略图"=>"", "回调"=>"", ...
-
作为建议,您可能应该使用以下说明安装
unicorngem:devcenter.heroku.com/articles/rails-unicorn -
另外,除非您能从日志中获得更具体的错误信息,否则没有人能提供太多帮助。 (抱歉,不知道具体建议什么来解决这个问题。也许其他人会知道...)
标签: ruby-on-rails heroku amazon-web-services amazon-s3 refinerycms