Welcome Guest | Login

Application Error (capistrano 1.4 :set_permissions)

I had an interesting time getting my first rails app to deploy. It turned out to be an enhancement to capistrano. With version 1.4 (possibly earlier), a :set_permissions task has been added which will "chmod -R g+w" your <railsapp>/release/######.  I found the references in the hostingrails tutorials and forums regarding the 755 perms for the dispatch.fcgi, but it turns out that the group write bit must be removed from the public directory as well. HARUMPH! The easiest fix is to not chmod the tree after it is checked out of the repository. Easily nuked by defining your own :set_permissions task in your config/deploy.rb script:

desc ""
task :set_permissions do
end

Jeff

2007-02-03 10:52 PM

heh Nice work. How much time did you spend on it? That sounds like something I would spend a day on lol. How did you troubleshoot that issue?



Seth

2007-02-03 11:17 PM

Seth
Jeff, thank you very much! I spent a lot of hours with a "Rails application error". After changing my deploy.rb script all works fine now. Again, thank you for this important hint!

2007-02-17 01:53 AM

I had the same problem. Thanks for the advice. It's really annoying that rails or dispatch or whatever it is gives such an unhelpful error to the browser and no logging information when the permissions are wrong. What a waste of time.

I changed my deploy.rb to:
# TODO improve, why does capistrano do this? smartify
desc "Set permissions to 755"
task :what_the_heck, :hosts => remote_domain do
 run "chmod 755 #{deploy_to}/current/public"
 run "chmod 755 #{deploy_to}/current/public/dispatch.*"
end

after "deploy:symlink", :what_the_heck
Thank you Jeff!

2009-07-03 01:52 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.



Previous URLs for this page here and here