Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PG::UndefinedTable - ERROR: relation "active_storage_attachments" does not exist

I just created a simple application for products and shopping cart with names, price and attachments. It's working fine without any issues. I decided to create admin and authentication using rails-admin gem and devise respectively.

I have followed the instructions as explained here. It all worked fine until I got to the rails_admin part. I did everything as described except using rails_admin 1.3 version as described on the github page. I also tried the older version on the link but I encounter this error each time

PG::UndefinedTable - ERROR:  relation "active_storage_attachments" does    not exist
 LINE 8:                WHERE a.attrelid = '"active_storage_attachmen...

I do not have any table by the name 'active_storage_attachments'. I found active_storage on the config file so I'm guessing this might be something caused by Rails configuration. Any assistance will be appreciated. If there is need to show some code from my app, I'll do that, although it's quite a huge code already.

Thanks in advance.

like image 306
KH_ Avatar asked Jun 11 '18 19:06

KH_


1 Answers

Did you run rails active_storage:install as described on this page? I believe this error might be due to your product attachments and the configuration which you mentioned.

like image 98
John Doe Avatar answered Oct 20 '22 22:10

John Doe