Before updating scaffolding from new DB schema, try creating

What does the message “error Before updating scaffolding from new DB
schema, try creating a table for your model (Legacy)” mean? My
googling shows that others have received similar messages, but it’s
not clear to me the import of the message.

Here’s what I’m doing which generates this error:

[thufir@localhost ~]$ mysql -u feeds -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21 to server version: 5.0.27\

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use legacy;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
±-----------------+
| Tables_in_legacy |
±-----------------+
| legacies |
±-----------------+
1 row in set (0.00 sec)

mysql> describe legacies;
±------------±-------------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±------------±-------------±-----±----±--------±---------------+
| id | int(11) | NO | PRI | NULL | auto_increment
|
| url | varchar(250) | NO | | |
|
| title | varchar(250) | NO | | |
|
| link | varchar(250) | YES | | NULL |
|
| description | varchar(250) | YES | | NULL |
|
±------------±-------------±-----±----±--------±---------------+
5 rows in set (0.00 sec)

mysql> quit
Bye
[thufir@localhost ~]$
[thufir@localhost ~]$ ./ruby.legacy.txt

Mon Jun 18 04:05:40 BST 2007
/home/thufir
thufir
Fedora Core release 6 (Zod)
X=0
while [ $X -le 20 ]
do
echo “”
X=$((X+1))
done

date
pwd
whoami
cat /etc/fedora-release
cat /home/thufir/ruby.legacy.txt

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

echo “the database configuration file”
cat /home/thufir/legacy/config/database.yml

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

#echo “rails lecacy…”
#this command only needs to be executed for the initial setup
rails legacy

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

#echo “ruby /home/thufir/legacy/script/generate controller hello…”
ruby /home/thufir/legacy/script/generate controller hello

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

echo “hello world” > /home/thufir/legacy/app/views/hello/index.rhtml

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

#echo “ruby /home/thufir/legacy/script/generate scaffold legacy…”
ruby /home/thufir/legacy/script/generate scaffold legacy

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

#echo “ruby script/server…”

echo “http://localhost:3000/legacies/list
echo “http://localhost:3000/legacy/list

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

ruby /home/thufir/legacy/script/server

the database configuration file

MySQL (default setup). Versions 4.1 and 5.0 are recommended.

Install the MySQL driver:

gem install mysql

On MacOS X:

gem install mysql – --include=/usr/local/lib

On Windows:

gem install mysql

Choose the win32 build.

Install MySQL and put its /bin directory on your path.

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: dummy
username: feeds
password: password
socket: /var/lib/mysql/mysql.sock

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: dummy
username: feeds
password: password
socket: /var/lib/mysql/mysql.sock

production:
adapter: mysql
database: dummy
username: feeds
password: password
socket: /var/lib/mysql/mysql.sock

  exists
  exists  app/controllers
  exists  app/helpers
  exists  app/models
  exists  app/views/layouts
  exists  config/environments
  exists  components
  exists  db
  exists  doc
  exists  lib
  exists  lib/tasks
  exists  log
  exists  public/images
  exists  public/javascripts
  exists  public/stylesheets
  exists  script/performance
  exists  script/process
  exists  test/fixtures
  exists  test/functional
  exists  test/integration
  exists  test/mocks/development
  exists  test/mocks/test
  exists  test/unit
  exists  vendor
  exists  vendor/plugins
  exists  tmp/sessions
  exists  tmp/sockets
  exists  tmp/cache
  exists  tmp/pids

identical Rakefile
identical README
identical app/controllers/application.rb
identical app/helpers/application_helper.rb
identical test/test_helper.rb
overwrite config/database.yml? [Ynaqd] n
skip config/database.yml
identical config/routes.rb
identical public/.htaccess
identical config/boot.rb
identical config/environment.rb
identical config/environments/production.rb
identical config/environments/development.rb
identical config/environments/test.rb
identical script/about
identical script/breakpointer
identical script/console
identical script/destroy
identical script/generate
identical script/performance/benchmarker
identical script/performance/profiler
identical script/process/reaper
identical script/process/spawner
identical script/process/inspector
identical script/runner
identical script/server
identical script/plugin
overwrite public/dispatch.rb? [Ynaqd] a
forcing app
force public/dispatch.rb
force public/dispatch.cgi
force public/dispatch.fcgi
identical public/404.html
identical public/500.html
identical public/index.html
identical public/favicon.ico
identical public/robots.txt
identical public/images/rails.png
identical public/javascripts/prototype.js
identical public/javascripts/effects.js
identical public/javascripts/dragdrop.js
identical public/javascripts/controls.js
identical public/javascripts/application.js
identical doc/README_FOR_APP
identical log/server.log
identical log/production.log
force log/development.log
identical log/test.log

  exists  app/controllers/
  exists  app/helpers/
  exists  app/views/hello
  exists  test/functional/

identical app/controllers/hello_controller.rb
identical test/functional/hello_controller_test.rb
identical app/helpers/hello_helper.rb

  exists  app/controllers/
  exists  app/helpers/
  exists  app/views/legacies
  exists  app/views/layouts/
  exists  test/functional/

dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
identical app/models/legacy.rb
identical test/unit/legacy_test.rb
identical test/fixtures/legacies.yml
error Before updating scaffolding from new DB schema, try
creating a table for your model (Legacy)

http://localhost:3000/legacies/list
http://localhost:3000/legacy/list

=> Booting WEBrick…
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-06-18 04:06:02] INFO WEBrick 1.3.1
[2007-06-18 04:06:02] INFO ruby 1.8.5 (2007-03-13) [i386-linux]
[2007-06-18 04:06:02] INFO WEBrick::HTTPServer#start: pid=5300
port=3000
127.0.0.1 - - [18/Jun/2007:04:06:06 BST] “GET /legacy/list HTTP/1.1”
404 625

  • → /legacy/list
    127.0.0.1 - - [18/Jun/2007:04:06:11 BST] “GET /legacy/list HTTP/1.1”
    404 625
  • → /legacy/list
    [2007-06-18 04:06:14] INFO going to shutdown …
    [2007-06-18 04:06:14] INFO WEBrick::HTTPServer#start done.
    [thufir@localhost ~]$

thanks,

Thufir

Thufir,

“error Before updating scaffolding from new DB
schema, try creating a table for your model (Legacy)”

It sounds like your model hasn’t got a table. Is it looking for
‘Legacies’? with capital L.

Xin

On Jun 18, 6:01 am, Xin Z. [email protected]
wrote:

Thufir,

“error Before updating scaffolding from new DB
schema, try creating a table for your model (Legacy)”

It sounds like your model hasn’t got a table. Is it looking for
‘Legacies’? with capital L.

Xin

model means database schema? MySQL shows a table with a small “l” :frowning:

or, model means something in ruby?

thanks,

Thufir (not at home)

On Jun 18, 2:01 pm, Xin Z. [email protected]
wrote:
[…]

It sounds like your model hasn’t got a table. Is it looking for
‘Legacies’? with capital L.
[…]

Changed the schema, and the database.yml file, same result:

[thufir@localhost ~]$ ./ruby.legacy.txt

Tue Jun 19 14:10:57 BST 2007
/home/thufir
thufir
Fedora Core release 6 (Zod)
X=0
while [ $X -le 20 ]
do
echo “”
X=$((X+1))
done

date
pwd
whoami
cat /etc/fedora-release
cat /home/thufir/ruby.legacy.txt

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

echo “the database configuration file”
cat /home/thufir/legacy/config/database.yml

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

#echo “rails lecacy…”
#this command only needs to be executed for the initial setup
rails legacy

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

#echo “ruby /home/thufir/legacy/script/generate controller hello…”
ruby /home/thufir/legacy/script/generate controller hello

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

echo “hello world” > /home/thufir/legacy/app/views/hello/index.rhtml

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

#echo “ruby /home/thufir/legacy/script/generate scaffold legacy…”
ruby /home/thufir/legacy/script/generate scaffold legacy

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

#echo “ruby script/server…”

echo “http://localhost:3000/legacies/list
echo “http://localhost:3000/legacy/list

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

X=0
while [ $X -le 5 ]
do
echo “”
X=$((X+1))
done

ruby /home/thufir/legacy/script/server

the database configuration file

MySQL (default setup). Versions 4.1 and 5.0 are recommended.

Install the MySQL driver:

gem install mysql

On MacOS X:

gem install mysql – --include=/usr/local/lib

On Windows:

gem install mysql

Choose the win32 build.

Install MySQL and put its /bin directory on your path.

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: Legacy
username: feeds
password: password
socket: /var/lib/mysql/mysql.sock

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: Legacy
username: feeds
password: password
socket: /var/lib/mysql/mysql.sock

production:
adapter: mysql
database: Legacy
username: feeds
password: password
socket: /var/lib/mysql/mysql.sock

  exists
  exists  app/controllers
  exists  app/helpers
  exists  app/models
  exists  app/views/layouts
  exists  config/environments
  exists  components
  exists  db
  exists  doc
  exists  lib
  exists  lib/tasks
  exists  log
  exists  public/images
  exists  public/javascripts
  exists  public/stylesheets
  exists  script/performance
  exists  script/process
  exists  test/fixtures
  exists  test/functional
  exists  test/integration
  exists  test/mocks/development
  exists  test/mocks/test
  exists  test/unit
  exists  vendor
  exists  vendor/plugins
  exists  tmp/sessions
  exists  tmp/sockets
  exists  tmp/cache
  exists  tmp/pids

identical Rakefile
identical README
identical app/controllers/application.rb
identical app/helpers/application_helper.rb
identical test/test_helper.rb
overwrite config/database.yml? [Ynaqd] n
skip config/database.yml
identical config/routes.rb
identical public/.htaccess
identical config/boot.rb
identical config/environment.rb
identical config/environments/production.rb
identical config/environments/development.rb
identical config/environments/test.rb
identical script/about
identical script/breakpointer
identical script/console
identical script/destroy
identical script/generate
identical script/performance/benchmarker
identical script/performance/profiler
identical script/process/reaper
identical script/process/spawner
identical script/process/inspector
identical script/runner
identical script/server
identical script/plugin
overwrite public/dispatch.rb? [Ynaqd] a
forcing app
force public/dispatch.rb
force public/dispatch.cgi
force public/dispatch.fcgi
identical public/404.html
identical public/500.html
identical public/index.html
identical public/favicon.ico
identical public/robots.txt
identical public/images/rails.png
identical public/javascripts/prototype.js
identical public/javascripts/effects.js
identical public/javascripts/dragdrop.js
identical public/javascripts/controls.js
identical public/javascripts/application.js
identical doc/README_FOR_APP
identical log/server.log
identical log/production.log
force log/development.log
identical log/test.log

  exists  app/controllers/
  exists  app/helpers/
  exists  app/views/hello
  exists  test/functional/

identical app/controllers/hello_controller.rb
identical test/functional/hello_controller_test.rb
identical app/helpers/hello_helper.rb

  exists  app/controllers/
  exists  app/helpers/
  exists  app/views/legacies
  exists  app/views/layouts/
  exists  test/functional/

dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
identical app/models/legacy.rb
identical test/unit/legacy_test.rb
identical test/fixtures/legacies.yml
error Before updating scaffolding from new DB schema, try
creating a table for your model (Legacy)

http://localhost:3000/legacies/list
http://localhost:3000/legacy/list

=> Booting WEBrick…
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-06-19 14:11:33] INFO WEBrick 1.3.1
[2007-06-19 14:11:33] INFO ruby 1.8.5 (2007-03-13) [i386-linux]
[2007-06-19 14:11:33] INFO WEBrick::HTTPServer#start: pid=7950
port=3000
[2007-06-19 14:11:41] INFO going to shutdown …
[2007-06-19 14:11:41] INFO WEBrick::HTTPServer#start done.
[thufir@localhost ~]$
[thufir@localhost ~]$ mysql -u feeds -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 25 to server version: 5.0.27

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use Legacy;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
±-----------------+
| Tables_in_Legacy |
±-----------------+
| Legacies |
±-----------------+
1 row in set (0.00 sec)

mysql> describe Legacies;
±------------±-------------±-----±----±--------±---------------+
| Field | Type | Null | Key | Default | Extra |
±------------±-------------±-----±----±--------±---------------+
| id | int(11) | NO | PRI | NULL | auto_increment
|
| url | varchar(250) | NO | | |
|
| title | varchar(250) | NO | | |
|
| link | varchar(250) | YES | | NULL |
|
| description | varchar(250) | YES | | NULL |
|
±------------±-------------±-----±----±--------±---------------+
5 rows in set (0.03 sec)

mysql> quit
Bye
[thufir@localhost ~]$
[thufir@localhost ~]$ date
Tue Jun 19 14:12:14 BST 2007
[thufir@localhost ~]$
[thufir@localhost ~]$

thanks,

Thufir