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


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.
    service: Disk
    root: <%= Rails.root.join("tmp/storage") %>

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

    service: "S3"
    access_key_id: xxxx
    secret_access_key: xxxx
    region: xxxx
    bucket: xxxx
  • But on calling[: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

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

Would you mind sharing your setup, please?

Join the discussion

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

Join 69,840+ 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.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.