Topic: newbie, getting error when setting up instantRail 2.0

After unpacking InstantRail 2.0 on my XP and create new app in rails_apps of cookbook2 by following the steps in Rolling with Ruby on Rails Revisited, I am getting the following error when running "ruby script\generate scaffold category category after creating the database"
:
C:\InstantRails-2.0-win\rails_apps\cookbook2>ruby script\generate scaffold receipe receipe
      exists  app/models/
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/receipes
      exists  app/views/layouts/
      exists  test/functional/
      exists  test/unit/
      create  app/views/receipes/index.html.erb
wrong number of arguments (1 for 2)

Any idea why and how this happens even I follow the steps from Rolling with Ruby on Rails Revisited?
Thanks.

Eric

Re: newbie, getting error when setting up instantRail 2.0

I'm getting the exact same error as Eric, using InstantRails v2.0 on Vista Home OS.

I was following the tutorial over at OnLamp, called "Rolling with Ruby on Rails REVISITED" at http://www.onlamp.com/pub/a/onlamp/2006 … tml?page=2

. installed InstantRails v2.0 without incident
. created new Rails project named "cooboo2"
. created database "cooboo2_development" in mysql
. granted all permission on db to 'odbc'@'localhost'
. created tables using the command

mysql cooboo2_development <db\create.sql

with the following create.sql script:

drop table if exists recipes;
drop table if exists categories;
create table categories (
    id                     int            not null auto_increment,
    name                   varchar(100)   not null default '',
    primary key(id)
) engine=InnoDB;

create table recipes (
    id                     int            not null auto_increment,
    category_id            int            not null,
    title                  varchar(100)   not null default '',
    description            varchar(255)   null,
    date                   date           null,
    instructions           text           null,
    constraint fk_recipes_categories foreign key(category_id) references categories(id),
    primary key(id)
) engine=InnoDB;


. still within the project home directory (cooboo2) I run the command

ruby script\generate scaffold recipe recipe

and get the following output/error:
(edit note: had put nbsp's in the quote and they didn't transform so removed them)

c:\IR2\rails_apps\cooboo2> ruby script\generate scaffold recipe recipe
       exists app/models/
       exists app/controllers/
       exists app/helpers/
       create app/views/recipes
       exists app/views/layouts/
       exists test/functional/
       exists test/unit/
       create app/views/recipes/index.html.erb
wrong number of arguments (1 for 2)

c:\IR2\rails_apps\cooboo2> _

Thanks in advance for any/all assistance! smile

Last edited by richard_harlos (2008-01-22 12:00:30)

Re: newbie, getting error when setting up instantRail 2.0

This seems like a typo. The line should read:

ruby script/generate scaffold recipe

edit: after further study, he is using IR Version 1.4, which uses a much older version of rails. The scaffold function worked slightly differently back then.

I suggest finding a more up to date tutorial, as many things have changed in recent versions of rails.

Last edited by pjleonhardt (2008-01-22 19:23:29)

Re: newbie, getting error when setting up instantRail 2.0

If you are using Rails 2.0, then scaffolding does not work that way anymore.
For starters check this out -
http://fairleads.blogspot.com/2007/12/r … -step.html
Go down to where they discusses new vs old and scaffolding.

Re: newbie, getting error when setting up instantRail 2.0

Thanks, fellow Railers!  That was just the direction I needed to get back in the game.

I bet most new-to-Rails folks sing its praises so I'll be in good company when I say, even at this early stage of my learning: I LOVE RAILS!

Ok, gotta get back to it... THANKS AGAIN!!!