This project is archived and is in readonly mode.

#3083 ✓invalid
dprickett

Database.yml without whitespace

Reported by dprickett | August 20th, 2009 @ 04:38 PM

In my database.yml file, if I do not put a whitespace after the colon I get the following error. This error is caused (I think) because the yaml parser crashes if there is not a whitespace after the colon and then gives a error message about the next line it interprets

For example:
adapter: mysql
encoding: utf8
reconnect: false
database:something (note, no whitespace here)
pool: 5

would yield the following error:

c:/ruby/lib/ruby/1.8/yaml.rb:133:in load': syntax error on line 23, col 2:' (ArgumentError)

    from c:/ruby/lib/ruby/1.8/yaml.rb:133:in `load'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:902:in `database_configuration'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:437:in `initialize_database'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:141:in `process'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:113:in `send'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/initializer.rb:113:in `run'
    from C:/test/config/environment.rb:9
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/commands/generate.rb:1
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/generate:3

Rails version: 2.3.3
Mysql gem: 2.7.3
Ruby version. 1.8.6 patchlevel 111
gem version: 1.3.5

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>

People watching this ticket

Pages