将在单机上运行的 Rails 服务器迁移到多机配置(VPC Loadbalancer 后面有 2 个乘客,1 个 mongo/redis)。但独立乘客抛出以下错误。任何建议的解决方案
[ pid=844 thr=11555480 file=utils.rb:176 time=2012-08-15 13:19:50.538 ]: *** Exception Errno::EACCES in application (Permission denied - /tmp/passenger.1.0.747/generation- 0/backends/ruby.CmC4pRejK75qNudAHhowIO0Z80iJELkiZcQMxRtxnZCOsxXeVv9Jx0xwt) (process 844, thread #<Thread:0x0000000160a530>):
from /var/lib/passenger-standalone/3.0.13-x86_64-ruby1.9.2-linux-gcc4.6.3-1002/support/lib/phusion_passenger/abstract_request_handler.rb:392:in `initialize'
from /var/lib/passenger-standalone/3.0.13-x86_64-ruby1.9.2-linux-gcc4.6.3-1002/support/lib/phusion_passenger/abstract_request_handler.rb:392:in `new'
from /var/lib/passenger-standalone/3.0.13-x86_64-ruby1.9.2-linux-gcc4.6.3-1002/support/lib/phusion_passenger/abstract_request_handler.rb:392:in `create_unix_socket_on_filesystem'
from /var/lib/passenger-standalone/3.0.13-x86_64-ruby1.9.2-linux-gcc4.6.3-1002/support/lib/phusion_passenger/abstract_request_handler.rb:174:in `initialize'
from /var/lib/passenger-standalone/3.0.13-x86_64-ruby1.9.2-linux-gcc4.6.3-1002/support/lib/phusion_passenger/rack/request_handler.rb:61:in `initialize'
挖掘后,我的 production.rb 归非 root 'ubuntu' 所有,他对 /tmp/passenger.1.0.747/generation-0/backends/ruby 没有写访问权限。
进步了,但仍然不知道如何解决它。
解决方法:所以问题是,capistrano 部署 + 乘客部署作为非 root 导致所有这些文件夹权限问题。必须恢复到根部署才能解决它