Phusion Passenger应用程序无法启动

时间:2016-01-12 02:42:23

标签: ruby-on-rails ruby raspberry-pi apache2

我有一些问题,并一直在互联网上搜索类似的问题,但我仍然卡住了。问题是关于apache2 + phusion乘客。我是在覆盆子pi上主持的。我已经设置了apache2和虚拟主机文件。但是当我测试应用程序时,我得到的应用程序无法从Phusion乘客开始。

当我连接到外部PC上的本地主机时,Phusion Passenger出错。日志文件:

[Mon Jan 11 22:37:07 2016] [notice] Apache/2.2.22 (Debian) Phusion_Passenger/3.0.13 PHP/5.4.45-0+deb7u2 configured -- resuming normal operations
[ pid=14842 thr=11296008 file=utils.rb:176 time=2016-01-11 22:37:10.346 ]: *** Exception LoadError in PhusionPassenger::Rack::ApplicationSpawner (cannot load such file -- bundler) (process 14842, thread #<Thread:0x158ba10>):
    from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:325:in `prepare_app_process'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/application_spawner.rb:156:in `block in initialize_server'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/utils.rb:572:in `report_app_init_status'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/application_spawner.rb:154:in `initialize_server'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:204:in `start_synchronously'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:180:in `start'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/rack/application_spawner.rb:129:in `start'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
    from <internal:prelude>:10:in `synchronize'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    from /usr/lib/ruby/vendor_ruby/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    from /usr/share/phusion-passenger/helper-scripts/passenger-spawn-server:99:in `<main>'

这是在我的/ apache2 / sites-available中 虚拟主机配置:

<VirtualHost *:80>
    ServerName 127.0.0.1
    DocumentRoot /var/www/testPage/public
    RailsEnv development
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    <Directory "/var/www/testPage/public">
        Options FollowSymLinks
    AllowOverride all
    </Directory>
</VirtualHost>

我还使用a2ensite将其切换为默认使用此配置。

ruby​​ -v

ruby 2.2.2p95 (2015-04-13 revision 50295) [armv6l-linux-eabihf]

rails -v

Rails 4.1.8
我的/ www

中的

gemfile

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]

2 个答案:

答案 0 :(得分:0)

尝试将文件夹的更改权限更改为777

sudo chmod -r 777 folder_path.

然后再次运行bundle重新启动apache2服务器

答案 1 :(得分:0)

确保Apache用户可以访问Phusion乘客。我假设您正在使用Debian发行版Rasbpian。在这种情况下,Apache用户可能是www-data。如果您使用的是CentOS,RedHat或Fedora,则默认的Apache用户名是apache。然而,这只是默认设置。某些软件(如cPanel)可能会更改默认的apache用户。对于cPanel,默认的apache用户名为nobody。请尝试以下命令来强制执行apache访问。

sudo chown -R www-data:www-data /phusion/passenger/installation/path