1
我正在使用Paperclip
和Fog
來處理雲存儲。雲存儲提供Openstack
API,這裏是我的設置:Ruby FOG和定製OpenStack提供程序:NotImplementedError
paperclip_defaults.rb
:
Paperclip::Attachment.default_options.update({
:path => "images/:class/:id/:attachment/:style/img_:fingerprint",
:storage => :fog,
:fog_credentials => {
:provider => 'OpenStack',
:openstack_auth_url => 'myurl',
:openstack_username => 'login',
:openstack_api_key => 'pass'
},
:fog_directory => 'dir',
:fog_public => true,
})
一切正常上傳,但我不能下載圖片! 這裏是堆棧跟蹤:
fog (1.23.0) lib/fog/openstack/models/storage/directory.rb:35:in `public_url'
fog (1.23.0) lib/fog/openstack/models/storage/files.rb:67:in `get_url'
fog (1.23.0) lib/fog/openstack/models/storage/file.rb:81:in `public_url'
paperclip (4.2.0) lib/paperclip/storage/fog.rb:136:in `public_url'
paperclip (4.2.0) lib/paperclip/storage/fog.rb:51:in `block (2 levels) in extended'
paperclip (4.2.0) lib/paperclip/interpolations.rb:34:in `block (2 levels) in interpolate'
paperclip (4.2.0) lib/paperclip/interpolations.rb:33:in `gsub'
paperclip (4.2.0) lib/paperclip/interpolations.rb:33:in `block in interpolate'
paperclip (4.2.0) lib/paperclip/interpolations.rb:32:in `each'
paperclip (4.2.0) lib/paperclip/interpolations.rb:32:in `inject'
paperclip (4.2.0) lib/paperclip/interpolations.rb:32:in `interpolate'
paperclip (4.2.0) lib/paperclip/url_generator.rb:13:in `for'
paperclip (4.2.0) lib/paperclip/attachment.rb:142:in `url'
NotImplementedError
public_url
總是返回此錯誤OpenStack的存儲。怎麼了?