轨道3 Carrierwave雾灯-S3的错误:应为(200)LT; =&GT;实际(404未找到) [英] Rails 3 Carrierwave-Fog-S3 error: Expected(200) <=> Actual(404 Not Found)
问题描述
我使用Carrerwave 0.5.3和我在我的画面控制器的创建方法调用Picture.save得到一个404错误。
I'm using Carrerwave 0.5.3 and getting a 404 error on my call to Picture.save in the Create method of my picture controller. Per the instructions in lib/carrierwave/storage/s3.rb I have the following in my initialization file (config/initializers/carrierwave_fog.rb):
CarrierWave.configure do |config|
config.s3_access_key_id = "xxxxx"
config.s3_secret_access_key = "xxxxx"
config.s3_bucket = "mybucket" #already created in my S3 account
end
在photo_uploader.rb我有:
In photo_uploader.rb I have:
class PhotoUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
storage :s3
def store_dir
"uploads" # already created in my s3 account
end
def cache_dir
"uploads/cache" #already created in my s3 account
end
end
确切的错误:
The exact error:
Excon::Errors::NotFound in PicturesController#create
Expected(200) <=> Actual(404 Not Found)
request => {:expects=>200}
response => #<Excon::Response:0x00000104a72448 @body="", @headers={}, @status=404>
我找到了一个稍微类似的问题在这里<一href="http://stackoverflow.com/questions/5481523/carrierwave-and-s3-with-heroku-error-undefined-method-fog-credentials">Carrierwave和S3与Heroku的错误未定义的方法`fog_credentials ='。但是,设置东西的方式,我把它现在在这种情况下,显然奏效。遗憾的是它并没有给我。
I found a slightly similar question here Carrierwave and s3 with heroku error undefined method `fog_credentials=' . But setting things up the way I have it now apparently worked in that case. Unfortunately it didn't for me.
我已经把照片在我的水桶,并设置权限为公共的,可以通过浏览器访问图片。因此,在AWS S3侧的东西似乎工作。
I've put a picture in my bucket and set the permissions to public and can access the picture via a browser. So things on the AWS S3 side seem to be working.
不知道下一步去哪里。任何想法?
Not sure where to go next. Any ideas?
推荐答案
嗯,我睡在这一个晚上回来的第二天,一切都很好。不知道为什么突然开始工作。
Well, I slept on this for a night came back the next day and all was good. Not sure why it suddenly started working.
这篇关于轨道3 Carrierwave雾灯-S3的错误:应为(200)LT; =&GT;实际(404未找到)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!