Chong Yow Tzen Chong Yow Tzen - 1 year ago 111
Ruby Question

Phusion Passenger application cannot be started

I have some problem and have been searching the internet for similar problem but I am still stuck. The problem is regarding apache2 + phusion passenger. I'm hosting on a raspberry pi. I have setup apache2 and virtual host files. But when I tested the application I get application cannot be start from Phusion passenger.

Error from Phusion Passenger when I connect to my localhost on an external PC. Log file:

[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>'

This is in my /apache2/sites-available
Virtual host config:

<VirtualHost *:80>
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

I have also switch it to use this config as default by using a2ensite.

ruby -v

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

rails -v

Rails 4.1.8

gemfile inside my /www

source ''

# 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 assets and views
gem 'coffee-rails', '~> 4.0.0'
# See 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:
gem 'turbolinks'
# Build JSON APIs with ease. Read more:
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]

Answer Source

Try change permission of folder to 777

sudo chmod -r 777 folder_path.

Then run bundle again restart apache2 server

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download