たびたびお世話になります。
突然、ActiveRecord::StatementInvalid
エラーが出るようになってしまいました。
ついさっきまでは、問題なく保存ができていたのですが。。。
以下がエラー文になります。
Started POST "/work_in/create" for ::1 at 2017-09-22 17:44:27 +0900 Processing by WorkInController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"vEbCTfEBBAMCJiNevwrMWtYZUktR2aTECI7xocxr3IhnRxT27nPWdrXkStcFtmBEi6iLxOlF0i1qmFfZTURjcw=="} (0.1ms) begin transaction SQL (5160.2ms) INSERT INTO "working_times" ("work_in_time", "created_at", "updated_at") VALUES (?, ?, ?) [["work_in_time", -4712-01-01 00:00:00 UTC], ["created_at", 2017-09-22 08:44:27 UTC], ["updated_at", 2017-09-22 08:44:27 UTC]] (0.2ms) rollback transaction Completed 500 Internal Server Error in 5164ms (ActiveRecord: 5160.5ms) ActiveRecord::StatementInvalid (SQLite3::BusyException: database is locked: INSERT INTO "working_times" ("work_in_time", "created_at", "updated_at") VALUES (?, ?, ?)):
ruby
1#controller 2class WorkInController < ApplicationController 3 def index 4 end 5 6 def new 7 end 8 9 def create 10 @work_in_time = WorkingTime.new 11 @work_in_time.work_in_time = DateTime.new 12 13 if @work_in_time.save 14 redirect_to top_page_path 15 flash[:notice] = "出勤時間を記録しました!" 16 else 17 redirect_to top_page_path 18 flash[:alert] = "出勤時間を記録できませんでした。もう一度お試しください。" 19 end 20 end 21 22end
初歩的な質問で申し訳ないですが、ご教授いただければと思います。
どうぞよろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/09/22 09:08
2017/09/22 09:19
退会済みユーザー
2017/09/22 09:23