Error while generating scaffold

Hello,

When I run the command:
“ruby script/generate scaffold Product Admin”

I receive the following error after the usual changed files info:
“Couldn’t find ‘product’ generator”

The command is based on “Agile Web Application Development with Rails”
first edition on page: 57. Just to give some context to what I am
doing, I just created the depot application, configured my database
(sqlite) entered the products table with the following SQL:

create table products(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
title varchar(100) NOT NULL,
description text NOT NULL,
image_url varchar(200) NOT NULL,
price money(10,2) NOT NULL
);

My database yml contains:
test:
adapter: sqlite
dbfile: db/test.db
production:
adapter: sqlite
dbfile: db/prod.db
development:
adapter: sqlite
dbfile: db/dev.db

And the db files are indeed in the rails db dir.

Ruby version: 1.8.5
Rails version: 1.1.4
OS: Mac OSX 10.4.7

Ruby, rails and SqLite are isntalled by darwinports. Not by gem, since
DarwinPorts gem install seems to be broken at the moment.

Any ideas how to solve this error?

Jeroen

Ok, I got the problem solved after some more searching and trial and
error.

Two things were wrong:

First, my database.yml now contains “sqlite3” as adapter.
Second, I had messed up my darwinports sqlite3 adapter installation by
FORGETTING to install swig.

End result: it works.
Too bad Ruby or sqlite doesn’t seem to mind putting oversized strings
into varchars with a fixed length.

Jeroen

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs