sqlite3的:: NotADatabaseException(文件将被加密或不是一个数据库)生产(EngineYard的) [英] SQLite3::NotADatabaseException (file is encrypted or is not a database) in production (Engineyard)
问题描述
我想(用sqlite3的,红宝石宝石)来解析在轨道3 sqlite3的数据库。数据库解析从文件上传过来。这里是我的控制器code:
I am trying to parse a sqlite3 database in rails 3 (using sqlite3-ruby gem). The database to parse is coming from a file upload. Here is my controller code:
require 'fileutils'
require 'sqlite3'
tmp = params[:file_upload][:my_file]
file = params[:file_upload][:my_file].tempfile
filename = params[:file_upload][:my_file].original_filename
file = File.join("public", params[:file_upload][:my_file].original_filename)
FileUtils.cp tmp.path, filename
db = SQLite3::Database.new(filename)
所以它工作得很好的地方,而不是在生产(与EngineYard的)。我得到以下错误:
So it works very well in local, but not in production (with EngineYard). I get the following error:
SQLite3::NotADatabaseException (file is encrypted or is not a database)
我不明白为什么。任何帮助将是非常美联社preciated,因为我真的不知道该如何解决这件事情。
I do not understand why. Any help would be very appreciated, because i really don't know how to solve this thing.
感谢
推荐答案
根据你自己的问题的在Amazon EC2上使用Engine Yard的sqlite的3.7 的似乎:) Engine Yard的前提是你使用SQLite 3.6,意思是@schlenk上面给出正确的答案: 该错误消息通常表明该数据库文件是与WAL模式,这需要MySQL 3.7,这Engine Yard的还没有提供创建。
According to your own question Sqlite 3.7 on amazon ec2 with Engine Yard it seems :) Engine Yard provided you with sqlite 3.6, meaning that @schlenk above gave the right answer: The error message typically indicates that the database file was created with WAL mode, which requires mysql 3.7, which Engine Yard do not yet offer.
这篇关于sqlite3的:: NotADatabaseException(文件将被加密或不是一个数据库)生产(EngineYard的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!