dnatoli
dnatoli

Reputation: 7012

Cap deploy doesn't create share/log folder

When I run my cap deploy, it complains that it can't access the log file:

Rails Error: Unable to access log file. Please ensure that /var/superduperapp/releases/20120329011558/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.

It seems that I have to manually create a log folder. Is there a way to do this with Capistrano so whoever is deploying it doesn't have to remember to create the folder each time they do a new deploy?

Upvotes: 9

Views: 3809

Answers (2)

shingara
shingara

Reputation: 46914

You can create a custom task to create this directory and launch it as the first task:

task :create_log_share do
  run "mkdir -p #{shared_path}/log"
end
before 'deploy:update', :create_log_share

This directory does not need to be created each the time when you deploy. Once is enough. The shared directory never changes.

Upvotes: 3

These folders should be created by capistrano when you run cap deploy:setup, have you ran it? To check if everything is fine you can run cap deploy:check before it.

Upvotes: 20

Related Questions