Search code examples
ruby-on-rails-4ubuntuapache2passengerruby-2.1

passenger with apache error "Could not download..."


I'm use: Ubuntu Ubuntu 15.04 x64, Ruby 2.1.4, Rails 4.2.3, Passenger 5.0.0.rc2 or later tryed, Apache 2.4.10.

I can't start project in production, because recieve the error:

[ 2015-08-24 10:40:53.2503 3427/7fc8ed450700 agents/HelperAgent/RequestHandler/CheckoutSession.cpp:252 ]: [Client 1-2] Cannot checkout session because a spawning error occurred. The identifier of the error is 952e5695. Please see earlier logs for details about the error.
App 3829 stdout:
App 3829 stderr:  --> Compiling passenger_native_support.so for the current Ruby interpreter...
App 3829 stderr:
App 3829 stderr:      (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
App 3829 stderr:
App 3829 stderr:  --> Downloading precompiled passenger_native_support.so for the current Ruby interpreter...
App 3829 stderr:
App 3829 stderr:      (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
App 3829 stderr:
App 3829 stderr:      Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/5.0.0.rc2/rubyext-ruby-2.1.4-x86_64-linux.tar.gz: The requested URL returned error: 404 Not Found
App 3829 stderr:      Trying next mirror...
App 3829 stderr:      Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/5.0.0.rc2/rubyext-ruby-2.1.4-x86_64-linux.tar.gz: The requested URL returned error: 403 Forbidden
App 3829 stderr:  --> Continuing without passenger_native_support.so.
App 3829 stdout:
[ 2015-08-24 12:00:43.5322 3427/7fc8f3c99700 Pool2/Implementation.cpp:287 ]: Could not spawn process for application /var/www/html/apptest: An error occured while starting up the preloader.
  Error ID: cddc003b
  Error details saved to: /tmp/passenger-error-V7RWyB.html
  Message from application: cannot load such file -- bundler/setup (LoadError)
  /usr/local/rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /usr/local/rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /usr/local/rvm/gems/ruby-2.1.4/gems/passenger-5.0.0.rc2/lib/phusion_passenger/loader_shared_helpers.rb:278:in `block in run_load_path_setup_code'
  /usr/local/rvm/gems/ruby-2.1.4/gems/passenger-5.0.0.rc2/lib/phusion_passenger/loader_shared_helpers.rb:381:in `running_bundler'
  /usr/local/rvm/gems/ruby-2.1.4/gems/passenger-5.0.0.rc2/lib/phusion_passenger/loader_shared_helpers.rb:276:in `run_load_path_setup_code'
  /usr/local/rvm/gems/ruby-2.1.4/gems/passenger-5.0.0.rc2/helper-scripts/rack-preloader.rb:99:in `preload_app'
  /usr/local/rvm/gems/ruby-2.1.4/gems/passenger-5.0.0.rc2/helper-scripts/rack-preloader.rb:157:in `<module:App>'
  /usr/local/rvm/gems/ruby-2.1.4/gems/passenger-5.0.0.rc2/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
  /usr/local/rvm/gems/ruby-2.1.4/gems/passenger-5.0.0.rc2/helper-scripts/rack-preloader.rb:28:in `<main>'

How can I solve it?


Solution

  • The "could not download" is not the actual issue here. As you can see, it later said "Continuing without passenger_native_support", meaning that it falled back to a mechanism that didn't require downloading anything. The actual issue is what came after that: "cannot load such file -- bundler/setup". That probably means your app is being run as the wrong user. Check the error details dump at /tmp/passenger-error-V7RWyB.html and double check whether all the settings are correct. In particular, double check whether the user is correct, and read on Passenger's user account sandboxing to learn how to fix that.