Error while upgrading 2.5 to 3.0

Got a problem while upgrading from 2.5 to 3.0 on my Ubuntu 20.04. (foreman-installer installed)

Saw error uninitialized constant Environment when I ran db:migrate.
Expected outcome:
No errors at all.

Other relevant data:
If I installed version 3.1 then the error disappeared.

I now wonder if missed anything by this? Did I get a complete db:migrate for both 3.0 and 3.1?
When I ran db:migrate successfully after upgrade to 3.1 I did see some output when I ran the db:migrate rake task.