Search code examples
ruby-on-railsdatabasesqlite3-rubyencryption

Ruby on Rails SQLite3::NotADatabaseException (file is encrypted or is not a database)


I am afraid something really bad happened while I was messing around with my RAILS app. It was working fine, and I am not sure what I did, but I get the following error:

Started GET "/" for 127.0.0.1 at 2011-03-30 02:20:15 -0500 Processing by PagesController#home as HTML Completed in 18ms

SQLite3::NotADatabaseException (file is encrypted or is not a database): app/models/user.rb:81:in authenticate_with_salt' app/helpers/sessions_helper.rb:79:inuser_from_remember_token' app/helpers/sessions_helper.rb:18:in current_user' app/helpers/sessions_helper.rb:23:insigned_in?' app/controllers/pages_controller.rb:9:in `home'

Rendered /Users/ikylim/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.8ms) Rendered /Users/ikylim/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.9ms) Rendered /Users/ikylim/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.0.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (5.2ms)

Anybody experience this? I really can't figure this out. Thanks a lot


Solution

  • Okay, I solved the problem by running:

    $ rake db:reset

    This deleted everything in the database that I had saved previously, but at least my app works again to work with. I am still unsure why this happened out of the blue, so hopefully somebody could provide an answer for future reference.