dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Rails 5.0 Error: couldn't json decode string got 743

Open adeelejaz opened this issue 9 years ago • 0 comments

On a new Rails 5.0 app, I'm getting the following error after uploading the images:

DRAGONFLY: couldn't json decode string - got 743: unexpected token at 'i٢'

My dragonfly initializer looks like this:

require 'dragonfly'

# Configure
Dragonfly.app.configure do
  plugin :imagemagick

  secret "snip"

  datastore :file,
      root_path: Rails.root.join('tmp', Rails.env),
      server_root: Rails.root.join('public') if Rails.env == 'development'

  datastore :s3,
      bucket_name: 'some-bucket',
      root_path: "some-path/#{Rails.env}",
      use_iam_profile: true unless Rails.env == 'development'
end

# Logger
Dragonfly.logger = Rails.logger

# Mount as middleware
Rails.application.middleware.use Dragonfly::Middleware

# Add model functionality
if defined?(ActiveRecord::Base)
  ActiveRecord::Base.extend Dragonfly::Model
  ActiveRecord::Base.extend Dragonfly::Model::Validations
end

Commenting out middleware line fixes the error.

adeelejaz avatar Sep 29 '16 09:09 adeelejaz