This project is archived and is in readonly mode.
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
-
dprickett August 20th, 2009 @ 04:41 PM
I'm sorry, I forgot to mention this error occurs after you make the edit to database.yml and then try to create a new migration or scaffolding
-
John Pignata August 25th, 2009 @ 03:55 AM
-1
I don't think this is a bug. According to the YAML spec: Mappings use a colon and space (“: ”) to mark each key: value pair
-
Matt Jones September 5th, 2009 @ 05:48 AM
- State changed from new to invalid
Not a bug - as John has noted, the missing space makes the file invalid YAML. Furthermore, the YAML parser is part of the Ruby standard library, so it's not a Rails issue in any case.
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>