All threads / Rails 6 Active storage setup - NameError Exception: uninitialized constant #<Class:0x00007fddde3597d8>::Analyzable

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Rails 6 Active storage setup - NameError Exception: uninitialized constant #<Class:0x00007fddde3597d8>::Analyzable

Meenakshi Badhan asked in Rails

I'm setting active storage with s3 in Rails 6.

  • I did rails active_storage:install and db:migrate.
  • In development.rb, i added: config.active_storage.service = :amazon
  • I added gem "aws-sdk-s3", require: false in my gemfile.
  • My model has this: has_one_attached :photo
  • This is my storage.yml.
 test:
    service: Disk
    root: <%= Rails.root.join("tmp/storage") %>

  local:
    service: Disk
    root: <%= Rails.root.join("storage") %>

  amazon:
    service: "S3"
    access_key_id: xxxx
    secret_access_key: xxxx
    region: xxxx
    bucket: xxxx
  • But on calling model.photo.attach(params[:photo']), i'm getting this error.
    *** NameError Exception: uninitialized constant #<Class:0x00007fddde3597d8>::Analyzable

  • My yml seems to be correct, i already checked it in yml validator. But,
    Rails.application.config_for(:storage) returns {}

Any suggestions would help.

I'm with the same issue, but only happens during the test

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 35,909+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.