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.

Reply

Seem here

Reply

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

Reply

I'm having trouble setting up S3 to work with Active Storage on a Heroku environment.

Would you mind sharing your setup, please?

Reply
Join the discussion
Create an account Log in

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

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

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