Since upgrading to rails 1.0 I keep getting a parse error in database.yml. I have tried multiple configurations of both mysql and postgres and continue getting this error message when trying to generate a model or scaffold. -Andrew
On 1/8/06, Andrew Gruner <gruner.rails@gmail.com> wrote:> Since upgrading to rails 1.0 I keep getting a parse error in database.yml. > > I have tried multiple configurations of both mysql and postgres and > continue getting this error message when trying to generate a model or > scaffold.And we''re supposed to magically know what the error is that you''re getting?
ruby script/generate model page
/usr/local/lib/ruby/1.8/yaml.rb:119:in `load'': parse error on line 6,
col -4: `test: (ArgumentError)
adapter: postgresql
database: musings-test
username: andrew
password: flubber
production:
adapter: postgresql
database: musings-production
username: andrew
password: flubber'' from /usr/local/lib/ruby/1.8/yaml.rb:119:in
`load''
from
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:424:in
`database_configuration''
from
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:168:in
`initialize_database''
from
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:83:in
`process''
from
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:42:in
`send''
from
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:42:in
`run''
from ./script/../config/../config/environment.rb:10
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require__''
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require''
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in
`require''
from
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/generate.rb:1
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require__''
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in
`require''
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in
`require''
from script/generate:3
Andrew Gruner wrote:> ruby script/generate model page > /usr/local/lib/ruby/1.8/yaml.rb:119:in `load'': parse error on line 6, > col -4: `test: (ArgumentError) > adapter: postgresql > database: musings-test > username: andrew > password: flubber > > production: > adapter: postgresql > database: musings-production > username: andrew > password: flubber'' from /usr/local/lib/ruby/1.8/yaml.rb:119:in `load''Shouldn''t those be underscores? musings_test, etc. Also be sure there are no tab characters in your YAML. regards Justin
On 1/9/06, Andrew Gruner <gruner.rails@gmail.com> wrote:> ruby script/generate model page > /usr/local/lib/ruby/1.8/yaml.rb:119:in `load'': parse error on line 6,So, what''s on line 6 of your config/database.yml file?
I figured it out. I had a "#" character in my password which was causing the parse error. Putting quotes around the password fixed it. I would guess that the # was being read as the start of a comment but I''m not sure why this would cause a parse error rather than just denying access. But it works now and I am happy. Thanks, -Andrew