NotImplementedError (#access_scopes= must be defined to handle storing access scopes: read_products)

NotImplementedError (#access_scopes= must be defined to handle storing access scopes: read_products)

HassanFarooq
Shopify Partner
1 0 0

Hi, I'm new to Shopify App Development.  I created a public app using "shopify_app" gem but when i try to install it on my development store i am facing this error.

NotImplementedError (#access_scopes= must be defined to handle storing access scopes: read_products)

Here is my shopify_app.rb file where i set my scope

ShopifyApp.configure do |config|
    config.application_name = "My Shopify App"
    config.old_secret = ""
    config.scope = 'read_products' 
    config.embedded_app = true
    config.after_authenticate_job = false
    config.api_version = "2022-01"
   config.shop_session_repository = 'Shop'

   config.reauth_on_access_scope_changes = true

   config.api_key = ENV.fetch('SHOPIFY_API_KEY', '').presence
   config.secret = ENV.fetch('SHOPIFY_API_SECRET', '').presence

    if defined? Rails::Server
       raise('Missing SHOPIFY_API_KEY. See https://github.com/Shopify/shopify_app#requirements') unless                config.api_key
      raise('Missing SHOPIFY_API_SECRET. See https://github.com/Shopify/shopify_app#requirements') unless config.secret
    end
end

 

Replies 3 (3)

richmillionaire
Visitor
2 0 3

Screenshot 2022-06-01 at 10.18.48.png

Please someone give a solution to this issue.

richmillionaire
Visitor
2 0 3

Fixed it now. Just add column string "access_scopes" to the Shop model.

 

eheiberg
Shopify Partner
2 0 0

Thank you so much! This helped out a lot. Don't know why it's like this. All I did was change the migration by adding: 

```ruby

t.string :access_scopes

```

To the `shops` migration and then running `rails migrate:redo`

 

Again thank you so much