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
You need to write this instead:
rails dbconsole test -p