Upyun
CarrierWave forThis gem adds support for Upyun.com to CarrierWave
Installation
gem install carrierwave-upyun
Gemfile
Or using Bundler, in gem 'rest-client'
gem 'carrierwave-upyun'
Configuration
You'll need to configure the to use this in config/initializes/carrierwave.rb
CarrierWave.configure do |config|
config.storage = :upyun
config.upyun_username = "xxxxxx"
config.upyun_password = 'xxxxxx'
config.upyun_bucket = "my_bucket"
config.upyun_bucket_domain = "my_bucket.files.example.com"
end
And then in your uploader, set the storage to :upyun
:
class AvatarUploader < CarrierWave::Uploader::Base
storage :upyun
end
You can override configuration item in individual uploader like this:
class AvatarUploader < CarrierWave::Uploader::Base
storage :upyun
self.upyun_bucket = "avatars"
self.upyun_bucket_domain = "avatars.files.example.com"
end