PhusionPassenger:无法启动Ruby(Rack)应用程序

时间:2013-02-22 06:40:00

标签: ruby-on-rails passenger

我是rails开发人员的新手,我在我的服务器上部署了rails应用程序。但现在它没有启动并在浏览器上给出错误,如下所示:

错误消息:

There was an error while trying to write to Gemfile.lock. It is likely that you need to allow write permissions for the file at path: /var/www/PCMI/zil/Gemfile.lock (Bundler::InstallError)

异常类:

PhusionPassenger::UnknownError

应用程序根目录:

/var/www/PCMI/zil 

回溯:

0  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/bundler-1.2.0/lib/       bundler/definition.rb  238  in `rescue in lock'

1  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/bundler-1.2.0/lib/bundler/definition.rb 223     in `lock'

2   /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/bundler-1.2.0/lib/bundler/environment.rb   39  in `lock'

3   /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/bundler-1.2.0/lib/bundler/runtime.rb   39  in `setup'

4   /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/bundler-1.2.0/lib/bundler.rb   116     in `setup'

5   /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb    326     in `prepare_app_process'

6   /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/rack/application_spawner.rb     156     in `block in initialize_server'

7   /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/utils.rb    563     in `report_app_init_status'

8   /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/rack/application_spawner.rb     154     in `initialize_server'

9   /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb  204     in `start_synchronously'

10  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb  180     in `start'

11  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/rack/application_spawner.rb     129     in `start'

12  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb    253     in `block (2 levels) in spawn_rack_application'

13  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb   132     in `lookup_or_add'

14  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb    246     in `block in spawn_rack_application'

15  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb   82  in `block in synchronize'

16  < td=""> <> prelude>    10:in `synchronize'

17  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server_collection.rb   79  in `synchronize'

18  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb    244     in `spawn_rack_application'

19  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb    137     in `spawn_application'

20  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/spawn_manager.rb    275     in `handle_spawn_application'

21  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb  357     in `server_main_loop'

22  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/lib/phusion_passenger/abstract_server.rb  206     in `start_synchronously'

23  /usr/local/rvm/gems/ruby-1.9.3-p125@domain_name/gems/passenger-3.0.17/helper-scripts/passenger-spawn-server     99  in `'

请检查浏览器中显示的错误。请帮我解决我的问题。 感谢。

1 个答案:

答案 0 :(得分:1)

看起来乘客无法写入您的gem文件的锁定文件。基本上它不能确定你没有捆绑运行,因为它无法获得该文件的独占锁定。

确保用户乘客在(apache默认为www-data)下运行该文件的写入权限。

您可以使用chownchmod

来完成此操作