Rails application not recognizing my Shop database table

sebas1
Shopify Partner
1 0 0

I just created a RoR shopify app, with the following generator:

rails generate shopify_app --api_key <your_api_key> --secret <your_app_secret>   

I added my domain to the whitelisted urls and everything but I keep getting this error, it seems like there is something broken inside the shopify app.

 

Also I already ran all the migrations, and checked in my console something lile Shop.last, to check that the model and db table DO exit.

 

My website is: application.delgic.com

My public key is: 94b2036e3d9c56ba430a6d33a3bb7ba7

The error appears when I put the site's url in my app in order to install it on it (application.delgic.com)

F, [2018-05-01T22:01:18.149098 #22506] FATAL -- : [cd2e0b4c-5dfd-422b-959f-7e191bc47ff1]   
F, [2018-05-01T22:01:18.149175 #22506] FATAL -- : [cd2e0b4c-5dfd-422b-959f-7e191bc47ff1] 


ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation "shops" does not exist
    LINE 8:                WHERE a.attrelid = '"shops"'::regclass
                                              ^
    :               SELECT a.attname, format_type(a.atttypid, a.atttypmod),
                         pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
                 (SELECT c.collname FROM pg_collation c, pg_type t
                   WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation),
                         col_description(a.attrelid, a.attnum) AS comment
                    FROM pg_attribute a LEFT JOIN pg_attrdef d
                      ON a.attrelid = d.adrelid AND a.attnum = d.adnum
                   WHERE a.attrelid = '"shops"'::regclass
                     AND a.attnum > 0 AND NOT a.attisdropped
                   ORDER BY a.attnum
    ):

F, [2018-05-01T22:01:18.149262 #22506] FATAL -- : [cd2e0b4c-5dfd-422b-959f-7e191bc47ff1]   
F, [2018-05-01T22:01:18.149329 #22506] FATAL -- : [cd2e0b4c-5
0 Likes
sizzlecentral
Shopify Partner
57 0 11

Make sure the whitelisted urls match exactly in your app, and in the app page in your Shopify developer admin. Also, if I try to install it it looks like you are using http instead of https.

Theme and app development | Toronto, Canada | sizzlecentral.com
0 Likes
policenauts
Pathfinder
98 6 18

Did you ever solve this? I am getting the same error during the callback step of OAuth. I deployed my app (built using shopify-cli) to Heroku and followed their instructions on how to migrate from sqlite to pg. The same app is still functioning for me in localhost. 

Edit: I solved it by running heroku run rake db:migrate and it worked.

 

0 Likes