Active Storage: TypeError: no explicit conversion of Symbol into String

1.2k Views Asked by At

I'm having a bit of trouble with using Active Storage on a Rails 5.2 app, which I only recently started building.

As an experiment, I set up a fresh rails application and set up Active Storage as the first thing, then built out a new scaffold, and it worked on the fresh application.

To really boil this down, if I go to the rails console for the non-working application, I get this:

> rails c
Running via Spring preloader in process 47792
Loading development environment (Rails 5.2.1)
[1] pry(main)> ActiveStorage
=> ActiveStorage
[2] pry(main)> ActiveStorage::Blob
TypeError: no implicit conversion of Symbol into String
from (erb):12:in `[]'

In the working application, I get this:

> rails c
Running via Spring preloader in process 48340
Loading development environment (Rails 5.2.1)
irb(main):001:0> ActiveStorage
=> ActiveStorage
irb(main):002:0> ActiveStorage::Blob
=> ActiveStorage::Blob (call 'ActiveStorage::Blob.connection' to establish a connection)

For whatever reason, it appears that Active Storage is only partially loaded. Any idea what might be causing this?

1

There are 1 best solutions below

0
On

Oddly enough, after removing all commented lines in my storage.yml, Active Storage worked. So the solution is to remove all comments in storage.yml.