When run on Phusion passenger, Bundler cannot find the Rails directory

穿精又带淫゛_ 提交于 2019-12-25 00:06:49

问题


So this is my problem. I used Capistrano to deploy my Rails 3 app to an Ubuntu server, which has Phusion Passenger 3 installed. Everything should have worked normal, but I kept getting this error message.

Could not locate Gemfile in /var/www/rails/releases/20100916074325. (Bundler::GemfileNotFound)

The directory in the error message (which I added for clarification) does exist on the system and so does the Gemfile. Underneath the error message, the stack trace showed the error is thrown inside

/usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/shared_helpers.rb

So I went in there and added outputs to check the existence of the the directories on that path, and every single one returned false all the way down to 'www'. I'm incredulous.

Why can't Bundler, running under Passenger, find these paths? What can I do to resolve it? (I'm about to give up on Passenger at this point.)


回答1:


This is almost definitely a permission issue. That said, please try Phusion Passenger git master; we've added aggressive permission checks so now it should tell you exactly what's wrong and what needs fixing instead of letting things error out with cryptic error messages like what you're seeing now.

Bundler thinks the paths don't exist because of permission problems. Specifically: File.directory?("/a/b/c") returns false if /, /a or /a/b don't have the right executable bits for the current process's owner.



来源:https://stackoverflow.com/questions/3740069/when-run-on-phusion-passenger-bundler-cannot-find-the-rails-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!