# Help with creating Scaffold

**URL:** <https://www.ruby-forum.com/t/help-with-creating-scaffold/51472>\
**Category:** Rails\
**Created:** [December 1, 2005, 8:49am UTC](https://www.ruby-forum.com/t/help-with-creating-scaffold/51472 "2005-12-01T08:49:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![untz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/ad7895/32.png) [@untz](https://www.ruby-forum.com/u/untz)\
**Post date:** [December 1, 2005, 8:49am UTC](https://www.ruby-forum.com/t/help-with-creating-scaffold/51472/1 "2005-12-01T08:49:58Z")

</div>

Hello there!

I am a Ruby on Rails newbie… Am currently reading the book, “Agile  
Web D. with Rails”, and am on page 57.

When I typed “ruby script/generate scaffold Product Admin”, I got the  
following error (Please note that this is the second time I ran  
this command and that’s why one will see the “identical” status marker):

Raven:/Developer/DevResources/Ruby/RailsApps/depot untz$ ruby script/  
generate scaffold Product Admin  
exists app/controllers/  
exists app/helpers/  
exists app/views/admin  
exists test/functional/  
dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
identical app/models/product.rb  
identical test/unit/product\_test.rb  
identical test/fixtures/products.yml  
#28000Access denied for user ‘root’@‘localhost’ (using password: NO)  
Raven:/Developer/DevResources/Ruby/RailsApps/depot untz$

I am using ruby 1.8.3 and rails 0.14.3 on Mac OS X Tiger…

Many, many thanks!

Kindest regards,

Unnsse

---

<div class="post-metadata">

**Author:** ![untz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/ad7895/32.png) [@untz](https://www.ruby-forum.com/u/untz)\
**Post date:** [December 1, 2005, 9:18am UTC](https://www.ruby-forum.com/t/help-with-creating-scaffold/51472/2 "2005-12-01T09:18:17Z")

</div>

Unnsse Khan wrote:

> generate scaffold Product Admin  
> identical test/fixtures/products.yml  
> #28000Access denied for user ‘root’@‘localhost’ (using password: NO)  
> Raven:/Developer/DevResources/Ruby/RailsApps/depot untz$

You get this when MySQL needs a password to connect to the database.  
Check your config/database.yml file and make sure you’ve put the correct  
password in there

Kev

---

<div class="post-metadata">

**Author:** ![untz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/ad7895/32.png) [@untz](https://www.ruby-forum.com/u/untz)\
**Post date:** [December 15, 2005, 5:44am UTC](https://www.ruby-forum.com/t/help-with-creating-scaffold/51472/3 "2005-12-15T05:44:40Z")

</div>

untz786 wrote:

> Hello again,
> 
> When I checked my database.yml file and placed my user name and  
> password…
> 
> And this is the new error that I get:
> 
> Raven:/Developer/DevResources/Ruby/RailsApps/depot untz$ ruby script/  
> generate scaffold Product Admin  
> /usr/local/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 17, col -2:`production: (ArgumentError)  
> adapter: mysql  
> database: depot\_production  
> socket: /tmp/mysql.sock  
> username: untz  
> password: wibble  
> …  
> production:  
> adapter: mysql  
> database: depot\_production  
> socket: /tmp/mysql.sock  
> username: untz  
> password: wibble

You have the same username with a different password for the production  
db. Create another valid user for production with a different pwd. I  
think it’ll solve the problem.

bakki

---

<div class="post-metadata">

**Author:** ![untz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/ad7895/32.png) [@untz](https://www.ruby-forum.com/u/untz)\
**Post date:** [December 1, 2005, 11:28pm UTC](https://www.ruby-forum.com/t/help-with-creating-scaffold/51472/4 "2005-12-01T23:28:06Z")

</div>

Hello again,

When I checked my database.yml file and placed my user name and  
password…

And this is the new error that I get:

Raven:/Developer/DevResources/Ruby/RailsApps/depot untz$ ruby script/  
generate scaffold Product Admin  
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 17, col -2:`production: (ArgumentError)  
adapter: mysql  
database: depot\_production  
socket: /tmp/mysql.sock  
username: untz  
password: wibble  
’ from /usr/local/lib/ruby/1.8/yaml.rb:133:in `load' from /usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/ initializer.rb:419:in`database\_configuration’  
from /usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/  
initializer.rb:163:in `initialize_database' from /usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/ initializer.rb:80:in`process’  
from /usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/  
initializer.rb:40:in `run' from ./config/environment.rb:10 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:21:in`require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.3/  
lib/active\_support/dependencies.rb:214:in `require' from /usr/local/lib/ruby/gems/1.8/gems/rails-0.14.3/lib/ commands/generate.rb:1 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/ custom_require.rb:21:in`require’  
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.3/  
lib/active\_support/dependencies.rb:214:in `require’  
from script/generate:3

Here’s the contents of the database.yml file:

development:  
adapter: mysql  
database: depot\_development  
socket: /tmp/mysql.sock  
username: untz  
password: shabu

# 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  
database: depot\_test  
socket: /tmp/mysql.sock  
username: untz  
password: shabu

production:  
adapter: mysql  
database: depot\_production  
socket: /tmp/mysql.sock  
username: untz  
password: wibble

Kindest regards,

Unnsse
