Search code examples
ruby-on-railsruby-on-rails-3sqlite3-ruby

Ruby On Rails Database


Whenever I run the command rvmsudo rake db:migrate (I need to use rvmsudo because I'm using rvm), the sqlite3 files generated are owned by root.

ls -l db/*.sqlite3

Because of this, I keep on getting a SQLite3 Read Only Error whenever I try to do anything to the database, and I have to manually enter the command:

sudo chown -R myusername db/*.sqlite3

rvmsudo rake db:migrate never did this before, and I am wondering why it is happening now.


Solution

  • Did you install RVM as root, and if so, is there a reason it wasn't installed as your normal (less-privileged) user? I use RVM daily, on a number of machines, and haven't had to install RVM as root.