This project is archived and is in readonly mode.

#1710 ✓wontfix
Ayose

dbconsole fails when database_configuration_file is changed

Reported by Ayose | January 7th, 2009 @ 06:50 PM | in 2.x

When you change database_configuration_file in config/environment.rb you can not use script/dbconsole.

In lib/commands/dbconsole.rb the config/database.yml value is hardcoded, so it ignores the application configuration.


env = ARGV.first || ENV['RAILS_ENV'] || 'development'
unless config = YAML::load(ERB.new(IO.read(RAILS_ROOT + "/config/database.yml")).result)[env]
  abort "No database is configured for the environment '#{env}'"
end

I suppose that this was done because it is a lot faster than load Rails environment.

Maybe there is no way to resolve this issue with a clean and fast solution, but I report it FYI :-)

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages