You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all I wanted to say that I love this lti_starter_app template, I'm working through some of the related YouTube tutorial videos on this template and they're proving very helpful; thank you so much for all of this content. Right now I appear to be at an impasse with an error in the code that won't allow me to proceed. I seem to be stuck at the database creation when I run rake db:setup and/or rake db:seed
When the script gets to the point of seeding the application instances, I run into this error:
CREATED ADMIN USER: [email protected] *** Seeding Sites *** Creating site: https://localhost:3000/ *** Seeding Applications *** Creating application: LTI Admin *** Seeding Application Instances *** rake aborted! NoMethodError: undefined method ``id' for nil:NilClass /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:135:in ``block in setup_application_instances' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:133:in ``each' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:133:in ``setup_application_instances' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:196:in ``block in <top (required)>' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:187:in ``each' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:187:in ``<top (required)>' Tasks: TOP => db:setup => db:seed (See full trace by running task with --trace)
It seems to me that the main issue is traced to attrs = attrs.merge(site_id: site.id) on line number 135. I'm not sure that site_id is defined in the template initially, and any attempts to give it a numerical value in various ways (hard coding it in the seeds.rb, defining in the secrets.yml and in .env) have failed. Would someone be able to guide me to a solution for this error? Thank you so much!
The text was updated successfully, but these errors were encountered:
It's possible that the site wasn't successfully created and so site.id was nil. Even in development we use a real URL - https://helloworld.atomicjolt.xyz. I wonder if using locahost:3000 fails validation.
Thanks for the response Justin. If my memory serves me, I had some trouble setting up a proper URL in my development space so I left it as localhost. Whenever I get some free time I'll give it another go and try to use a proper URL, then update the thread here on the status.
Hello,
First of all I wanted to say that I love this lti_starter_app template, I'm working through some of the related YouTube tutorial videos on this template and they're proving very helpful; thank you so much for all of this content. Right now I appear to be at an impasse with an error in the code that won't allow me to proceed. I seem to be stuck at the database creation when I run
rake db:setup
and/orrake db:seed
When the script gets to the point of seeding the application instances, I run into this error:
CREATED ADMIN USER: [email protected] *** Seeding Sites *** Creating site: https://localhost:3000/ *** Seeding Applications *** Creating application: LTI Admin *** Seeding Application Instances *** rake aborted! NoMethodError: undefined method ``id' for nil:NilClass /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:135:in ``block in setup_application_instances' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:133:in ``each' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:133:in ``setup_application_instances' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:196:in ``block in <top (required)>' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:187:in ``each' /Users/Dan/Documents_Local/devlocal/canvas/atomic_jolt/LTI_Starter/LTI-SAKs/lti_saks_4/db/seeds.rb:187:in ``<top (required)>' Tasks: TOP => db:setup => db:seed (See full trace by running task with --trace)
It seems to me that the main issue is traced to
attrs = attrs.merge(site_id: site.id)
on line number 135. I'm not sure thatsite_id
is defined in the template initially, and any attempts to give it a numerical value in various ways (hard coding it in the seeds.rb, defining in the secrets.yml and in .env) have failed. Would someone be able to guide me to a solution for this error? Thank you so much!The text was updated successfully, but these errors were encountered: