Hi, I'm a complete newbie with Rails, working through the Agile Web Development with Rails book. On Windows XP Pro.
I got the tutorial development stuff through chapter 11 working OK, now I am at the chapter on testing and stuck.
Database.yml looks like:
development:
adapter: firebird
database: depot
username: ogston
password: ******
host: localhost
# 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: firebird
database: depot_test
username: ogston
password: ******
host: localhost
#production:
adapter: firebird
database: depot_production
username: ogston
password: ******
host: localhost
The test database looks OK when accessed through the IB_SQL gui. In particular the table USERS is there.
(Database connection is through the file aliases.conf)
When I run a test:
>ruby test/unit/user_test.rb
I get back:
Loaded suite test/unit/user_test
Started
EE
Finished in 0.078 seconds.
1) Error:
test_truth(UserTest):
ActiveRecord::StatementInvalid: FireRuby::FireRubyException: Error preparing a S
QL statement.
Dynamic SQL Error
SQL error code = -204
Table unknown
USERS
At line 1, column 13.
Undefined name
SQL Code = -204
Firebird Code = 335544569
: DELETE FROM USERS
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/connection_adapters/abstract_adapter.rb:120:in `log'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/connection_adapters/firebird_adapter.rb:316:in `delete' C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/fixtures.rb:284:in `delete_existing_fixtures'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/fixtures.rb:256:in `create_fixtures'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/fixtures.rb:256:in `create_fixtures'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/connection_adapters/abstract/database_statements.rb:51:in `transaction'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/fixtures.rb:255:in `create_fixtures'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/base.rb:794:in `silence'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/fixtures.rb:248:in `create_fixtures'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/fixtures.rb:566:in `load_fixtures'
C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_
record/fixtures.rb:513:in `setup'
My question is: how do I go about debugging this program. My thought is to test whether ruby has established the database connection OK, if not what might be causing this problem. Or what else might be going on.
Thanks,
Walter
|