Ruby on Rails SQLite3 :: NotADatabaseException(文件被加密或不是数据库) [英] Ruby on Rails SQLite3::NotADatabaseException (file is encrypted or is not a database)

查看:172
本文介绍了Ruby on Rails SQLite3 :: NotADatabaseException(文件被加密或不是数据库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我害怕发生了一些非常糟糕的事情,当时我正在和我的RAILS应用程序混乱。它工作正常,我不知道我做了什么,但是我收到以下错误:



开始GET/为127.0.0.1在2011-03- 30 02:20:15 -0500
由PagesController处理#home为HTML
在18ms内完成

SQLite3 :: NotADatabaseException(文件被加密或不是数据库):
app / models / user.rb:81:in authenticate_with_salt'
app / helpers / sessions_helper.rb:79:in
user_from_remember_token'
app / helpers / sessions_helper.rb:18:in current_user'
app / helpers / sessions_helper.rb:23:in
signed_in? '
app / controllers / pages_controller.rb:9:在'home'



渲染/Users/ikylim/.rvm/gems/ruby-1.9.2 -p0 / gems / actionpack-3.0.1 / lib / action_dispatch / middleware / templates / rescues / _trace.erb(0.8ms)
渲染/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)
呈现/Users/ikylim/.rvm/g拯救/布局(5.2ms)中的ems / ruby​​-1.9.2-p0 / gems / actionpack-3.0.1 / lib / action_dispatch / middleware / templates / rescues / diagnostics.erb


$ b $有谁体验过这个?我真的无法弄清楚这一点。感谢很多

解决方案

好的,我通过运行以下方式解决了问题:



$ rake db:reset



这删除了我以前保存的数据库中的所有内容,但至少我的应用程序可以再次工作。我仍然不确定为什么这发生在蓝色之中,所以希望有人可以提供一个答案供将来参考。


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

解决方案

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.

这篇关于Ruby on Rails SQLite3 :: NotADatabaseException(文件被加密或不是数据库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆