# Problems with basic Rails

**URL:** <https://www.ruby-forum.com/t/problems-with-basic-rails/189775>\
**Category:** Rails\
**Created:** [June 7, 2010, 3:46pm UTC](https://www.ruby-forum.com/t/problems-with-basic-rails/189775 "2010-06-07T15:46:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![punkaruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@punkaruby](https://www.ruby-forum.com/u/punkaruby)\
**Post date:** [June 7, 2010, 3:46pm UTC](https://www.ruby-forum.com/t/problems-with-basic-rails/189775/1 "2010-06-07T15:46:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![punkaruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@punkaruby](https://www.ruby-forum.com/u/punkaruby)\
**Post date:** [June 7, 2010, 3:51pm UTC](https://www.ruby-forum.com/t/problems-with-basic-rails/189775/2 "2010-06-07T15:51:12Z")

</div>

not use 1.9.1  
//  
crash log please

Ivan N.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![punkaruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@punkaruby](https://www.ruby-forum.com/u/punkaruby)\
**Post date:** [June 7, 2010, 3:55pm UTC](https://www.ruby-forum.com/t/problems-with-basic-rails/189775/3 "2010-06-07T15:55:54Z")

</div>

On Mon, Jun 7, 2010 at 6:46 AM, An Car [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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 S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![punkaruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@punkaruby](https://www.ruby-forum.com/u/punkaruby)\
**Post date:** [June 7, 2010, 4:44pm UTC](https://www.ruby-forum.com/t/problems-with-basic-rails/189775/4 "2010-06-07T16:44:29Z")

</div>

On 7 June 2010 14:46, An Car [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all,  
> I’m a newbie

Have a look at the rails guides at [http://guides.rubyonrails.org/](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
