I had gotten these errors, it has to do with where those constants are defined, the location is different in the generated version and the source zip. When I posted about the environment files, I was not getting those errors. I thought I had given myself a fresh generated set of files and then only copied over the environment files, but I guess not. I don't have time to do any work on this now, but when I do I'll post here again if I find anything.
FYI, I believe those constants are defined in a boot.rb file, which is in the generated version but not the source.zip. I don't know where tehy are defined in the source.zip, but I would guess the environment files based on your experience.