想知道是否有人可以帮助我设置带有数字海洋的机车。我在托管点,说明要求我修改carrierwave.rb 文件中的生产块。目前它是为 AWS 设置的。我需要做什么才能让 digitalocean 正常工作。
CarrierWave.configure do |config|
config.cache_dir = File.join(Rails.root, 'tmp', 'uploads')
case Rails.env.to_sym
when :development
config.storage = :file
config.root = File.join(Rails.root, 'public')
when :production
# the following configuration works for Amazon S3
config.storage = :fog
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: ENV['S3_KEY_ID'],
aws_secret_access_key: ENV['S3_SECRET_KEY'],
region: ENV['S3_BUCKET_REGION']
}
config.fog_directory = ENV['S3_BUCKET']
else
# settings for the local filesystem
config.storage = :file
config.root = File.join(Rails.root, 'public')
end
end