problems with basic Rails

0 views
Skip to first unread message

An Car

unread,
Jun 7, 2010, 9:46:24 AM6/7/10
to rubyonra...@googlegroups.com
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

--
Posted via http://www.ruby-forum.com/.

Ivan Nastyukhin

unread,
Jun 7, 2010, 9:49:10 AM6/7/10
to rubyonra...@googlegroups.com
not use 1.9.1
//
crash log please

Ivan Nastyukhin
diei...@me.com

> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>

Hassan Schroeder

unread,
Jun 7, 2010, 9:54:20 AM6/7/10
to rubyonra...@googlegroups.com
On Mon, Jun 7, 2010 at 6:46 AM, An Car <li...@ruby-forum.com> wrote:

> 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.
--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan

Colin Law

unread,
Jun 7, 2010, 9:57:41 AM6/7/10
to rubyonra...@googlegroups.com
On 7 June 2010 14:46, An Car <li...@ruby-forum.com> wrote:
> Hi all,
> I'm a newbie

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

Reply all
Reply to author
Forward
0 new messages