Carrierwave and Linode Object Storage


Using Rails 5.2, I'm having trouble getting the carrierwave config right in order to get image uploads working with Linode's object storage.

I can save an object through the rails console without problems with the access keys, bucket and endpoint info:

client =
  endpoint: "...",
  access_key_id: "...",
  secret_access_key: "...",
  region: "default",

  bucket: "...",
  key: "test-object",
  body: 'Hello World!'

Here's the carrierwave config:

CarrierWave.configure do |config| = :fog
  config.fog_provider = 'fog/aws'
  config.fog_credentials = {
    provider:              'AWS', 
    aws_access_key_id:     '...',    
    aws_secret_access_key: '...', 
    region:                'default',
    endpoint:              '...'
  config.fog_directory  = '<my-bucket>'
  config.fog_public     = false
  config.fog_attributes = {
    'Cache-Control' => "max-age=#{}",
    'X-Content-Type-Options' => "nosniff"

I'm probably missing a detail here, another pair of eyes would be great :)


2 Replies

The error I get is a validation error on the file type, requiring it to be jpeg, jpg or png. Though it's a jpeg I'm uploading.

…just started working, out of the blue. No new changes to config or system :shrug:


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct