problems with basic Rails

Hi all, I'm a newbie

I've installed RoR on win 7 and this is script\about

About your application's environment Ruby version 1.9.1 (i386-mingw32) RubyGems version 1.3.7 Rack version 1.1 Rails version 2.3.8 Active Record version 2.3.8 Active Resource version 2.3.8 Action Mailer version 2.3.8 Active Support version 2.3.8 Application root F:/rubyProject/depot Environment development Database adapter mysql Database schema version 0

I did: 1- rails depot -d mysql 2- rake db:create 3- I've created "products" table with mysql command line editor 4- ruby script\generate scaffold Product 5- I Start webrick 6- go on localhost:3000/products and find (correctly) an empty list 7- I want insert a new product, click on "new" but the page is empty (see img attached)

and if I click on "create" ruby crashes...

Maybe Rails can't connect with Mysql or something else...

database.yml:

development:   adapter: mysql   encoding: utf8   reconnect: false   database: depot_development   pool: 5   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   encoding: utf8   reconnect: false   database: depot_test   pool: 5   username: root   password: password   host: localhost

production:   adapter: mysql   encoding: utf8   reconnect: false   database: depot_production   pool: 5   username: root   password: password   host: localhost

Could anybody help me ??

Maaaany thanks

Attachments: http://www.ruby-forum.com/attachment/4776/emptyForm.jpg

not use 1.9.1 // crash log please

Ivan Nastyukhin dieinzige@me.com

I did: 1- rails depot -d mysql 2- rake db:create 3- I've created "products" table with mysql command line editor 4- ruby script\generate scaffold Product 5- I Start webrick

Whoa, what? It appears you've tried to create a Product model but not specified any attributes for it, so it's not surprising you'd get an empty "new" page.

Second, after you create a new model, you need to get that info into the database, using `rake db:migrate`.

6- go on localhost:3000/products and find (correctly) an empty list 7- I want insert a new product, click on "new" but the page is empty (see img attached)

Maybe Rails can't connect with Mysql or something else...

Uh, "maybe"? You can easily determine that by either looking at your log file, or opening a console and trying something that will need to do a DB access.

But build a proper model and run migrations first, and see what happens.

Have a look at the rails guides at http://guides.rubyonrails.org/. Start with Getting Started, oddly enough. That will explain some things you are missing and should get you going. The ones on ActiveRecord relationships and Debugging are also compulsory reading.

Colin