Project

General

Profile

Actions

Defect #13004

closed

Bundle may fail because of the way config/database.yml is parsed

Added by Etienne Massip almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
High
Category:
Rails support
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

database.yml is loaded differently in Gemfile than Rails do (Rails ERB-parse the file before YAML-parsing it).

Because of that, application won't start anymore with database.yml files which Rails succeed to load otherwise.

The Rails way:

require 'erb'
YAML::load(ERB.new(IO.read(paths["config/database"].first)).result)

Actions #1

Updated by Etienne Massip almost 12 years ago

  • Status changed from New to Confirmed
Actions #2

Updated by Etienne Massip almost 12 years ago

  • Assignee deleted (Jean-Philippe Lang)

Side note: I'm not convinced it's a good idea to put so much intelligence in this file but I don't really have a better idea.

Maybe something like a database_conf Rails-environment dependent rake task which would initialize the database.yml file with the right adapter and database configuration by interactively asking the user?
It would also bundle config without the useless adapters.

Not really nice either, I know…

Actions #3

Updated by Jean-Philippe Lang almost 12 years ago

  • Subject changed from Bundle fail because of the way config/database.yml is parsed to Bundle may fail because of the way config/database.yml is parsed
  • Status changed from Confirmed to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fixed in r11286.

Indeed, this solution is far from ideal but the problem with the --without is that you'll install new adapters when they are added to Redmine's Gemfile. For example, you bundled Redmine with --without postgresql sqlite3, and now that we have added sqlserver, you will install sqlserver gems when updating your bundle after an upgrade and most certainly get an error because freetds-dev is not installed.

Actions #4

Updated by Etienne Massip almost 12 years ago

  • Target version deleted (2.3.0)

Removed from Changelog since devel -> devel?

Actions

Also available in: Atom PDF