Hello.
I’m new to RoR. I run RoR on my Slackware. I follow the depot example
and have a problem when run the script:
root@localhost:~/work/depot# ruby script/generate scaffold Admin Product
/usr/lib/ruby/1.8/yaml.rb:133:in load': syntax error on line 5, col 2: socket:/var/run/mysql/mysql.sock’ (ArgumentError)
from /usr/lib/ruby/1.8/yaml.rb:133:in load' from /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:424:indatabase_configuration’
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:168:in initialize_database' from /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:83:inprocess’
from
/usr/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/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in require' from /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/generate.rb:1 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in
`require’
from script/generate:3
I have check file socket /var/run/mysql/mysql.sock, it exists. I don’t
know how to fix.
what do i have to do to make it work ?
You have an error in the syntax of your database.yml file. You must
have only spaces and no tabs are allowed in yaml. Go through your
whole databse.yml file again and make sure there are no extra spaces
or tabs at all and you should be ok.
Cheers-
-Ezra
On Jan 29, 2006, at 11:49 AM, thong le duc wrote:
from
from ./script/../config/../config/environment.rb:10
from
Thanks, Ezra. It’s worked.
Actually, i have checked database.yml several times before post the
question but i didn’t notice tabs, didn’t know that tabs aren’t allowed.
Yeah Dave… I asked you what would cause a syntax error in a yaml file
after your rails
talk at a NFJS and you said you had no idea! Sorry, couldn’t
resist…
Really though, a default comment in the yaml generator would save lots
of angst and
frustration (that syntax error so took the wind out of my sails that I
blew off rails for
a couple weeks).
Could be even simpler than Dave’s idea: “NOTE: YAML DOES NOT ALLOW
TABS”.
b
PS: It was a really good presentation though Dave…
Hopefully it will not strike someone again (wishful thinking)!
Maybe the next best thing to do is to run a script before starting the
server to check for dumb things like that…
Thanks!
Dominique
joe ld wrote:
Thanks, Ezra. It’s worked.
Actually, i have checked database.yml several times before post the
question but i didn’t notice tabs, didn’t know that tabs aren’t allowed.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.