How to fix NoMethodError: undefined method `id' for nil:NilClass when visiting the QPixel homepage? Question
Following the set up guide I was able to start rails server and got my very first QPixel page served (see screenshot):
Unfortunately it was a 500 Server Error
, which I did not expect and which wasn't mentioned in the guide. Attached is part of the console output which speaks of a NoMethodError (undefined method
id' for nil:NilClass)`. It's incomplete because of a cloudflare block, more of it is here.
Started GET "/" for 127.0.0.1 at 2022-01-06 09:55:55 +0100
[...]
NoMethodError (undefined method `id' for nil:NilClass):
[...]
Completed 500 Internal Server Error in 360ms (Views: 204.1ms | ActiveRecord: 26.5ms)
Is this intended behavior or a bug (and if so how to fix it)?
I tried to continue with the guide and signed up a user, but that didn't change anything about the error. It seems like the dev community is not set up correctly.
In trying to reach this point I repeated steps of the manual several times (and encountered other errors), so maybe I compromised the state of the installation somewhere. I will repeat the guide on a clean system again to be sure. Nevertheless this question should remain as something that might happen to others as well.
1 answer
You don't have a homepage category set. Go to the category list (/categories), pick one to be the homepage, edit it and tick the homepage option, then save it and try again.
If that's not in the setup guide, it probably should be!
0 comment threads