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):
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
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.
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:indatabase_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:inprocess’
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:inrequire’
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:inrequire’
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