Derek Belsham
2006-Jan-16 02:40 UTC
[Rails] the dreaded "Before updating scaffolding from new DB schema, try creating a table for your model (Blog)" error
Hi
Can any one help me with this? I think that this is soemthing quite
simple as there is quite abit traffic about this on the web and everyone
sems to figure it out. I have tried most of the solutions that I can
find. but nothing.
I have mysql 5.0.11 working on linux redhat 9. ruby is working rails
install mysql library seem to be there.
to some trying rt get mysql to install need to point the installer to
the correct mysql. I have the table created an am usein the example in
linux journal to test it out.
I am new to ruby and rails but think it may have potential for some
ideas I have.
[derek@192 Blog]$ script/generate scaffold Blog 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/blog.rb
identical test/unit/blog_test.rb
identical test/fixtures/blogs.yml
error Before updating scaffolding from new DB schema, try
creating a table for your model (Blog)
my database
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
#
# Get the fast C bindings:
# gem install mysql
# (on OS X: gem install mysql -- --include=/usr/local/lib)
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql
database: blog_development
username: derek
password: wcug13
socket: /tmp/mysql.sock
# Connect on a TCP socket. If omitted, the adapter will connect on the
# domain socket given by socket instead.
#host: localhost
#port: 3306
# 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: blog_test
username: derek
password: wcug13
socket: /tmp/mysql.sock
production:
adapter: mysql
database: blog_production
username: derek
password: wcug13
socket: /tmp/mysql.sock
Derek
Kevin Olbrich
2006-Jan-16 04:12 UTC
[Rails] Re: the dreaded "Before updating scaffolding from new DB sch
You just need to create a ''blog'' table in your database before running the scaffold generator. It should have an ''id'' column at least. BTW...I wouldn''t recommend posting the password to your mysql server in the mailing list, even if it is just a development machine. -- Posted via http://www.ruby-forum.com/.
Tim Buchalka
2006-Jan-16 05:04 UTC
[Rails] the dreaded "Before updating scaffolding from new DB schema, try creating a table for your model (Blog)" error
Are you sure the database table exists and the username/password is correct? Try connecting to mysql from the command prompt using that username and password and see what happens. Cheers Tim On 1/17/06, Derek Belsham <derek@westcreekltd.com> wrote:> > Hi > Can any one help me with this? I think that this is soemthing quite > simple as there is quite abit traffic about this on the web and everyone > sems to figure it out. I have tried most of the solutions that I can > find. but nothing. > > I have mysql 5.0.11 working on linux redhat 9. ruby is working rails > install mysql library seem to be there. > to some trying rt get mysql to install need to point the installer to > the correct mysql. I have the table created an am usein the example in > linux journal to test it out. > > I am new to ruby and rails but think it may have potential for some > ideas I have. > > [derek@192 Blog]$ script/generate scaffold Blog 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/blog.rb > identical test/unit/blog_test.rb > identical test/fixtures/blogs.yml > error Before updating scaffolding from new DB schema, try > creating a table for your model (Blog) > > my database > # MySQL (default setup). Versions 4.1 and 5.0 are recommended. > # > # Get the fast C bindings: > # gem install mysql > # (on OS X: gem install mysql -- --include=/usr/local/lib) > # And be sure to use new-style password hashing: > # http://dev.mysql.com/doc/refman/5.0/en/old-client.html > development: > adapter: mysql > database: blog_development > username: derek > password: wcug13 > socket: /tmp/mysql.sock > > # Connect on a TCP socket. If omitted, the adapter will connect on the > # domain socket given by socket instead. > #host: localhost > #port: 3306 > > # 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: blog_test > username: derek > password: wcug13 > socket: /tmp/mysql.sock > > production: > adapter: mysql > database: blog_production > username: derek > password: wcug13 > socket: /tmp/mysql.sock > > > Derek > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060116/56688f89/attachment-0001.html
dbelsham
2006-Jan-16 06:48 UTC
[Rails] Re: the dreaded "Before updating scaffolding from new DB sch
Kevin Olbrich wrote:> > You just need to create a ''blog'' table in your database before running > the scaffold generator. > > It should have an ''id'' column at least. > > BTW...I wouldn''t recommend posting the password to your mysql server in > the mailing list, even if it is just a development machine.One thousand thank yous. The problem was I did create a "Blog" table instad of a "blog" table. I suspect that I had some library problems at first as well. Any way thanks again Derek -- Posted via http://www.ruby-forum.com/.