I ran into a “chicken before the egg” problem where a gem was expecting
tables to be present when loaded which was fine until you try and build
db from scratch using db:setup. When it hits db:schema:load the
loads and the gem errors out as the tables aren’t present. I made a
task that connected to ActiveRecord and then loads the schema file.
essentially the same methods as db:create uses to create the db and
schema:load uses to load the schema. This seems to work without
Is there a reason the environment is normally loaded for this task? Just
wondering If I’m missing something that’ll kick me in the ass later.
I read and followed some issues about
but they don’t say why they decided to load or not load the env at the