There is a bug in Rails 3's dbconsole script, which makes the following command open a database console for the development environment:
dbconsole
development
rails dbconsole -p test
Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)
You need to write this instead:
rails dbconsole test -p