Parse error in database.yml


#1

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


#2

On 1/8/06, Andrew G. removed_email_address@domain.invalid 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?


#3

Andrew G. wrote:

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


#4

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:indatabase_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:inprocess’
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:inrun’
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:inrequire’
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:inrequire__’
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:inrequire’
from script/generate:3


#5

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


#6

On 1/9/06, Andrew G. removed_email_address@domain.invalid 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?