This commit 28ef6e6#diff-e50e457d8517d82c3828c357d305a74e seems to have caused a regression.
revert back to simple on_server? returning !Rails.const_defined?('Console')
In debugging this it seem there is some old unreachable code in connection#needs_initialization.