Forum: Ruby on Rails Trying to reproduce "Creating a weblog in 15 minutes"

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.
E4e3e31f24d1fe554ad3f79ea84d2c98?d=identicon&s=25 bluejaguar (Guest)
on 2007-07-03 21:59
(Received via mailing list)
This is exactly 3 minutes into the video rails_take2_with_sound.mov
from http://www.rubyonrails.org/screencasts.

I have just created the database and posts table.  I'm on a Windows
box.

Let's say for a newbie this type of error is under-informed and a show
stopper.


C:\ruby\brablog>..\bin\ruby ./script/generate model Post
C:/ruby/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 32,
col -1: `'
(ArgumentError)
        from C:/ruby/lib/ruby/1.8/yaml.rb:133:in `load'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:523:in `database_configuration'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:228:in `initialize_database'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:88:in `process'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:43:in `send'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:43:in `run'
        from ./script/../config/../config/environment.rb:13
        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/
generate.rb:1
        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
        from ./script/generate:3


My database.yml is as follows:

# MySQL (default setup).  Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
#   gem install mysql
# On MacOS X:
#   gem install mysql -- --include=/usr/local/lib
# On Windows:
#   gem install mysql
#       Choose the win32 build.
#       Install MySQL and put its /bin directory on your path.
#
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
  adapter: mysql
  database: blog_development
  username: root
  password: password
  host: localhost

# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: blog_test
  username: root
  password: password
  host: localhost

production:
  development
92e8dce1e16e4f92632aa44f3359a9e6?d=identicon&s=25 Huw Collingbourne (Guest)
on 2007-07-03 22:22
We have some tutorials (screencasts plus written text) explaining the
whole thing. We use our IDE, Ruby In Steel in these. However, if you are
using some other IDE, you can still follow the essential details of our
tutorial, cutting and pasting the Ruby/RHTML code as you need it.

There's an old tutorial here (with a PDF download of instructions plus a
screencast):
http://www.sapphiresteel.com/Create-a-Weblog-With-...

That is an 'exact' copy of the DHH tutorial. The IDE used is a (now
quite old) beta version of Ruby In Steel Personal Edition.

We have a newer and slightly adapted Blog tutorial (with migrations)
here:

part one:
http://www.sapphiresteel.com/How-To-Create-a-Ruby-...
part two:
http://www.sapphiresteel.com/How-To-Create-A-Ruby-...

The IDE in this tutorial is Ruby In Steel Developer 1.1.

best wishes
Huw

SapphireSteel Software
http://www.sapphiresteel.com/
E4e3e31f24d1fe554ad3f79ea84d2c98?d=identicon&s=25 bluejaguar (Guest)
on 2007-07-05 15:04
(Received via mailing list)
Hi,

Choosing another tutorial is one option.

However, no one in the Ruby community can tell me what the error is
that I'm running into?

C:\ruby\brablog>..\bin\ruby ./script/generate model Post
C:/ruby/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 32,
col -1: `'
(ArgumentError)
        from C:/ruby/lib/ruby/1.8/yaml.rb:133:in `load'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:523:in `database_configuration'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:228:in `initialize_database'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:88:in `process'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:43:in `send'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
initializer.rb:43:in `run'
        from ./script/../config/../config/environment.rb:13
        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:
27:in `gem_original_require'
        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:
27:in `require'
        from C:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/
generate.rb:1
        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:
27:in `gem_original_require'
        from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:
27:in `require'
        from ./script/generate:3




On Jul 3, 4:22 pm, Huw Collingbourne <rails-mailing-l...@andreas-
E4e3e31f24d1fe554ad3f79ea84d2c98?d=identicon&s=25 bluejaguar (Guest)
on 2007-07-05 16:22
(Received via mailing list)
Ok, so I figured this out myself.

It appears ruby files (in my case my database.yml) cannot deal with a
TAB CHARACTER ????

If this is defined with a tab in front of development I get the parse
error.

production:
        development

If I change this to no tab (spaces), it will parse and complete.

WT*?  Who writes a parser that deals with human edited files and
cannot deal with tabs ?

Please make the parser smart enough to handle this.

And if you can't parse a character please output the ASCII and/or
'\0x' values of the characters that messed up the parser

AND what the file was that was being parsed.

PLEASE
Ae82cad40a0caca9c932d45c7a9eb3cd?d=identicon&s=25 Michael Glaesemann (Guest)
on 2007-07-05 16:37
(Received via mailing list)
On Jul 5, 2007, at 8:33 , bluejaguar wrote:

> It appears ruby files (in my case my database.yml) cannot deal with a
> TAB CHARACTER ????

database.yml is a YAML file and not particular to Ruby (or Rails, for
that matter). See the YAML spec.

http://www.yaml.org/

In particular, their FAQ:

http://www.yaml.org/faq.html

Michael Glaesemann
grzm seespotcode net
This topic is locked and can not be replied to.