Hi! I''ve got a very strange problem. Suddenly the SQLite3 Backend stopped working. Example 1:> rake db:rollback== CreateProducts: reverting ================================================-- drop_table(:products) rake aborted! An error has occurred, this and all later migrations canceled: SQLite3::SQLException: near "CASCADE": syntax error: DROP TABLE "products" CASCADE I googled for this error message, but didn''t find anything useful. BTW, there is nothing special in the migration script: class CreateProducts < ActiveRecord::Migration # ... def self.down drop_table :products end end Example 2:> rake testLoaded suite /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader Started E Finished in 0.046598 seconds. 1) Error: test_product_attributes_must_not_be_empty(ProductTest): SystemStackError: stack level too deep /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rails_sql_views-0.8.0/lib/rails_sql_views/connection_adapters/abstract_adapter.rb:23 1 tests, 0 assertions, 0 failures, 1 errors, 0 skips It doesn''t matter, what is in the test. Any test will fail, even if I just write ''assert true'' there. Those problems disappear if I change to another backend, for example MySQL. Any Ideas? P.S. My OS is Ubuntu Linux 10.10 with latest Updates. SQLite3 Version is 3.7.2-1ubuntu0.1. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Mar 21, 2011 at 11:14 PM, Hashbang Hashbang <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Hi! > > I''ve got a very strange problem. Suddenly the SQLite3 Backend stopped > working. > > Example 1: > > > rake db:rollback > > == CreateProducts: reverting > ================================================> -- drop_table(:products) > rake aborted! > An error has occurred, this and all later migrations canceled: > > SQLite3::SQLException: near "CASCADE": syntax error: DROP TABLE > "products" CASCADE > > I googled for this error message, but didn''t find anything useful. > > BTW, there is nothing special in the migration script: > > class CreateProducts < ActiveRecord::Migration > # ... > def self.down > drop_table :products > end > end > > > Example 2: > > > rake test > > Loaded suite > > /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake/rake_test_loader > Started > E > Finished in 0.046598 seconds. > > 1) Error: > test_product_attributes_must_not_be_empty(ProductTest): > SystemStackError: stack level too deep > > /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rails_sql_views-0.8.0/lib/rails_sql_views/connection_adapters/abstract_adapter.rb:23 > > 1 tests, 0 assertions, 0 failures, 1 errors, 0 skips > > > It doesn''t matter, what is in the test. Any test will fail, even if I > just write ''assert true'' there. > > Those problems disappear if I change to another backend, for example > MySQL. Any Ideas? > >Your migration failed and you have a partially migrated database in SQLite. I would suggest dropping and recreating your test database by hand and then running your tests again. B. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Bryan Crossland wrote in post #988721:> Your migration failed and you have a partially migrated database in > SQLite. > I would suggest dropping and recreating your test database by hand and > then running your tests again.Unfortunately, that did not help. I deleted the database and recreated it (BTW, this is a really simple test project with just one relation), but I still get the same error. I still cannot do rake db:rollback in the development environment. This is the output with --trace: ** Invoke db:rollback (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:rollback == CreateProducts: reverting ================================================-- drop_table(:products) rake aborted! An error has occurred, this and all later migrations canceled: SQLite3::SQLException: near "CASCADE": syntax error: DROP TABLE "products" CASCADE /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `rescue in log'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract_adapter.rb:199:in `log'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/connection_adapters/sqlite_adapter.rb:135:in `execute'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rails_sql_views-0.8.0/lib/rails_sql_views/connection_adapters/abstract/schema_statements.rb:62:in `drop_table_with_cascade'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:383:in `block in method_missing'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:359:in `block in say_with_time'' /home/vlad/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/benchmark.rb:294:in `measure'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:359:in `say_with_time'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:379:in `method_missing'' /home/vlad/workspace/depot/db/migrate/20110315224838_create_products.rb:14:in `down'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:312:in `block in migrate'' /home/vlad/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/benchmark.rb:294:in `measure'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:312:in `migrate'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:395:in `migrate'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:537:in `block (2 levels) in migrate'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:611:in `call'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:611:in `block in ddl_transaction'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/transactions.rb:207:in `transaction'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:611:in `ddl_transaction'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:536:in `block in migrate'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:523:in `each'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:523:in `migrate'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:437:in `down'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:480:in `move'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/migration.rb:425:in `rollback'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/activerecord-3.0.5/lib/active_record/railties/databases.rake:211:in `block (2 levels) in <top (required)>'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:636:in `call'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:631:in `each'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:631:in `execute'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'' /home/vlad/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2029:in `each'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/lib/rake.rb:1998:in `run'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/bin/rake:19:in `load'' /home/vlad/.rvm/gems/ruby-1.9.2-p136/bin/rake:19:in `<main>'' rake db:migrate run without any errors. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Apparently Analagous Threads
- OS X - `require': no such file to load -- sqlite3/sqlite3_native
- Does RSpec interfere with Pathname#dirname or Pathname#realpath ?
- rvm install 1.8.7 prompts "There has been an error while running make. Halting the installation."
- Controller Testing + Devise = boom (undefined @controller, request)
- Error reverse engineering MySQL with RMRE