I’ve searched everywher for an answer to my problem, and the only thing
I’ve found is people with the same problem. I’m hoping someone has an
answer here:
I’m working through the agile web developement with rails book and when
I goto scaffold the products table I get the following message.
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
error Before updating scaffolding from new DB schema, try
creating a tab
le for your model (Product)
For the life of me I cannot figure out the problem. I’ve reinstalled a
million times.
My config file is as followed.
development:
adapter: mysql
database: depot_dev
username: root
password: admin
host: localhost
test:
adapter: mysql
database: depot_test
username: root
password:admin
host: localhost
production:
adapter: mysql
database: depot_production
username: root
password: admin
host: localhost
Thanks for any help. I’m excited to actually get rails working.
It looks like you do not have a products table anymore. I’m sure you
do, but would you verify that.
Michael
If its any help I inculuded the port definition in my database file:
development:
adapter: mysql
database: cwpdb
username: root
password: *******
host: localhost
port: 3306
There is a products table in each of the databases. I’ve tried different
combos of having the host name/and port number. Nothing seems to work.
On XP if your using instant rails my setups all seem to have no password
and work fine?
password:
Richard Hart wrote:
If its any help I inculuded the port definition in my database file:
development:
adapter: mysql
database: cwpdb
username: root
password: *******
host: localhost
port: 3306
Sorry to bust into this dialogue, but I have run into a similar problem
on my Mac. When I try to execute:
ruby script/generate scaffold item
my Terminal (like DOS in Windows) window justs hangs. Generate
Controller and Generate Model work fine. Then when I put scaffold :item
in the controller and go to open /item/new or item/list I get a
NoMethodError. It appears to be a breakdown in communication to the db.
I am using the same database.yml config as Richard above. I am also
using MySQL. Ideas?
Thanks,
David
I would guess your mysql root password hasn’t been set then.
Anyone else have any ideas on this?
What happens if you leave off the host, port, and socked?
Michael
Perhaps its the ‘root@localhost’ != ‘root@%’ security feature.
Erik.
bryan smith schreef:
Michael T. wrote:
What’s your environment look like? Are you using InstantRails? If
not you might try that and see if the problem goes away.
Win xp
Mysql 4.1
IIS
Not a fan of all in one packages. Is it very good for developement. I
thought it looked good for production only.
What’s your environment look like? Are you using InstantRails? If
not you might try that and see if the problem goes away.
What happens when you try to telnet localhost 3306? Are you able to
connect
using the mysql commandline client?
XP is probably configured to block the port with the Windows firewall.
Tony
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
bryan smith wrote:
programs to externall connect to it through 3306.
Any other ideas?
I had some issues with mysql4 so I use mysql5 which works like a charm.
Connection issues. Try switching.
=======================================
| MVH Mats L. |
| Systemutvecklare / Webbutvecklare |
| +46-8-6747466 |
| Enheten för IT och media |
| http://www.it.su.se/ |
| http://www.su.se/ |
| Stockholms universitet |
| S-106 91 STOCKHOLM |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFD+xomoKZhClUZTE8RAhdiAJ4kNINXT5bbROF0i7VWt6MFUPWygQCeK1fe
s5ppt370pgDvGFXzTolhU9Y=
=mbgE
-----END PGP SIGNATURE-----
Tony C. wrote:
What happens when you try to telnet localhost 3306? Are you able to
connect
using the mysql commandline client?
XP is probably configured to block the port with the Windows firewall.
Tony
It’s free and clear. Windows firewall is turned off. And I can use other
programs to externall connect to it through 3306.
Any other ideas?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
bryan smith wrote:
ding ding ding ding ding, bob we have a winner.
I connected to our test mysql box here at work (running mysql 5) and it
worked or at least no error messages.
Thanks!
so the question is “what the heck is up with mysql4 on rails?”! 
Congrats, dude. 
=======================================
| MVH Mats L. |
| Systemutvecklare / Webbutvecklare |
| +46-8-6747466 |
| Enheten för IT och media |
| http://www.it.su.se/ |
| http://www.su.se/ |
| Stockholms universitet |
| S-106 91 STOCKHOLM |
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFD+yK+oKZhClUZTE8RApLkAJ4jWl7aNc39NXXIG3yfgN94jA+tNQCeJR5s
k9JglzHlPa6ypX9NPAYro/w=
=URsa
-----END PGP SIGNATURE-----
ding ding ding ding ding, bob we have a winner.
I connected to our test mysql box here at work (running mysql 5) and it
worked or at least no error messages.
Thanks!
Glad you got it working. There were some issues with MySQL4 and the
password change, but your error doesn’t point to that problem.
FWIW, I know you’re reluctant to use an all in one solution, but you
have to ask yourself do you want to spend a lot of time mucking with
software configurations or do you want to spend that time having fun
with Rails. InstantRails is a great solution, because it’s zero
installation, doesn’t mess up your machine, and if you don’t like you
just delete the directory. Of course I wouldn’t use anything like
this in a production environment, I’m just speaking for development
purposes. Let Curt H. have all the headaches while you get some
real work done. Just a recommendation.
Michael