当对Phusion乘客运行时,Bundler无法找到Rails目录(When run on Phusion passenger, Bundler cannot find the Rails directory)

13 IT屋

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.)

解决方案

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.

所以这是我的问题。我使用Capistrano将Rails 3应用程序部署到安装了Phusion Passenger 3的Ubuntu服务器上。一切都应该正常工作,但我一直收到此错误消息。




无法在/ var / www / rails / releases / 20100916074325中找到Gemfile。 (Bundler :: GemfileNotFound)




错误消息中的目录(我为澄清而添加)确实存在于系统上,因此也存在Gemfile。在错误消息下方,堆栈跟踪显示错误已引发




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




所以我去了那里,并添加了输出以检查是否存在路径上的所有目录,并且每一个返回false一直到'www'。我太不可思议了



为什么在"乘客"下奔跑的Bundler找不到这些路径?我该怎么解决? (这时我将放弃乘客。)


解决方案

这几乎肯定是一个权限问题。也就是说,请尝试Phusion Passenger git master;我们已经添加了积极的权限检查,所以现在它应该告诉您确切的问题和需要解决的问题,而不是像现在看到的那样通过神秘的错误消息让事情出错。



Bundler认为由于权限问题,路径不存在。具体来说: File.directory?(" / a / b / c")如果 / , / a 或 / a / b 没有适合当前进程所有者的可执行位。


本文地址:IT屋 » 当对Phusion乘客运行时,Bundler无法找到Rails目录