canvas-lms icon indicating copy to clipboard operation
canvas-lms copied to clipboard

modifying config/*.yml files requires changing file ownership

Open tylerclair opened this issue 15 years ago • 1 comments

I added my API information to the scribd config file and tried to run RAILS_ENV=production rake db:generate_data but since the instructions had me change the owner of the config files the rake command fails with this error: (in /var/rails/canvas) rake aborted! Permission denied - /var/rails/canvas/config/security.yml

To fix the problem I simply changed the owner of the files back to my username i.e: sudo chown canvasadmin config/*.yml I re-ran the rake command and it worked but then I got this error: Rails Error: Unable to access log file. Please ensure that /var/rails/canvas/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

So I went back and performed the same thing on all the other files the instructions had me change i.e: sudo chown -R canvasadmin config/environment.rb log tmp public/assets public/stylesheets/compiled Gemfile.lock

I re-ran the rake command and restarted apache and everything configured fine. Just remember to re-run the chown commands with canvasuser to get things back in order.

Is there a simpler method to ensure the rake commands run successfully without changing file owners eachtime? Does the rake command need to be ran each time a config file is changed or can I just restart apache?

Thanks, Tyler

tylerclair avatar Feb 04 '11 20:02 tylerclair

rake db:generate_data only needs to be run when the domain.yml file is changed currently. i'm going to try and make it so rake db:generate_data doesn't need to be run at all. i tried to update the documentation recently to reflect this, but i wasn't very clear.

I've found that the following incantation works pretty well

sysadmin@appserver:/var/rails/canvas$ sudo su canvasuser -c "env GEM_HOME=/path/to/gem/home RAILS_ENV=production rake db:generate_data"

That way it runs as the user with the ownership settings.

jtolio avatar Feb 04 '11 21:02 jtolio