1
votes

I recently moved my Rails app from one folder to another. It runs perfectly in the original folder. I copied everything.

I think this may be devise related, since I use it for user management, and I have the db as full read/write/execute. Any suggestions are greatly appreciated, I'm new to rails.

Without any modification, I'm now getting this error when running:

ActiveRecord::StatementInvalid in Devise::RegistrationsController#create

SQLite3::ReadOnlyException: attempt to write a readonly database: INSERT INTO "users" ("created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "first_name", "last_name", "last_sign_in_at", "last_sign_in_ip", "profile_name", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) Rails.root: /home/rails

1
May be looking at the write-access of the folder into which you are moving your code might help?uday

1 Answers

4
votes

My guess is you copied the file from a directory owned by another user. Here it complains about the user rails not being able to open the database.sqlite3. Executing sudo chown -R rails db/ should give the rails user the access to the database.

You are the rails user right? According to /home/rails