Forum: Ruby on Rails Depot example problem on Slackware

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
63073008b9e04db4c7af1ef37787df8d?d=identicon&s=25 Joe Ld (ldt)
on 2006-01-29 20:49
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:in
`database_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:in
`process'
        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:in `require'
        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:in `require'
        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 ?

Thanks
8e44c65ac5b896da534ef2440121c953?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-01-30 02:43
(Received via mailing list)
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
>
> --
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

-Ezra Zygmuntowicz
WebMaster
Yakima Herald-Republic Newspaper
ezra@yakima-herald.com
509-577-7732
63073008b9e04db4c7af1ef37787df8d?d=identicon&s=25 Joe Ld (ldt)
on 2006-01-30 07:54
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.
F98e8bbc010d8ff9818c2f46319b86cc?d=identicon&s=25 Dominique Plante (dplante)
on 2006-01-30 10:10
Yes! the whole tab thing in the YAML should be better documented.

NO TABS IN YAMLS, ONLY SPACES.

I just added this gotcha to
http://wiki.rubyonrails.org/rails/pages/Gotcha

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.
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-01-30 10:53
(Received via mailing list)
Dominique Plante wrote:
> Yes! the whole tab thing in the YAML should be better documented.
Have you *seen* the yaml.org faq?  :-)
5d06917e13b29bcff1c1609492c06873?d=identicon&s=25 Dave Thomas (Guest)
on 2006-02-03 16:12
(Received via mailing list)
On Jan 30, 2006, at 3:54 AM, Alex Young wrote:

>> Yes! the whole tab thing in the YAML should be better documented.
> Have you *seen* the yaml.org faq?  :-)

I believe the point is that 99.9999% of people using database.yml
will not have.

It happens often enough that perhaps the first line of the generated
database.yml file for a new project should say

   # IF YOU SEE STRANGE PROBLEMS WHEN STARTING YOUR APP, CHECK FOR
TABS IN THIS FILE
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-02-03 19:28
(Received via mailing list)
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....
This topic is locked and can not be replied to.