乘客错误'cannot load such file: ... union_station_hooks_core'



我的rails应用程序上收到以下错误:

Web application could not be started
cannot load such file -- /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core (LoadError)
  /u/sf/netmon/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /u/sf/netmon/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/ruby_supportlib/phusion_passenger.rb:235:in `require_passenger_lib'
  /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:232:in `before_loading_app_code_step1'
  /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/helper-scripts/rack-preloader.rb:99:in `preload_app'
  /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
  /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
  /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/helper-scripts/rack-preloader.rb:29:in `<main>'
Error ID
28518bd5

查看文件系统:

-bash-4.1$ pwd
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core
-bash-4.1$ tree
.
0 directories, 0 files

所以显然确实没有这样的文件...我应该如何解决这个问题?

我的宝石文件:

source 'https://rubygems.org'
gem 'rails', git: 'https://github.com/rails/rails', branch: '4-2-stable'
gem 'actionpack-action_caching'
gem 'pg'
gem 'redis'
gem 'rubytree'
gem 'turbolinks'
gem 'jquery-rails'
gem 'jquery-datatables-rails', git: 'https://github.com/rweng/jquery-datatables-rails'
gem 'rails-timeago'
gem 'dygraphs-rails'
gem 'underscore-rails'
gem 'd3_rails'
gem 'twitter-bootstrap-rails', '= 2.2.8'
gem 'less-rails'
gem 'coffee-rails', git: 'https://github.com/rails/coffee-rails'
gem 'coffeebeans'
gem 'jquery-ui-rails'
group :assets do
  gem 'sass-rails',   git: 'https://github.com/rails/sass-rails', branch: '5-0-stable'
  gem 'therubyracer', platforms: :ruby
  gem 'uglifier', '>= 1.0.3'
end
gem 'jbuilder', '~> 1.0.1'
gem 'passenger', git: 'https://github.com/FooBarWidget/passenger', branch: 'stable-5.0'
gem 'rack-webauth'
gem 'bunny'

通过 ruby-build 和乘客的 apache 模块安装 ruby 2.3.0 时未报告任何错误:

$ ./passenger-install-apache2-module
...
Validating installation...
 * Checking whether this Passenger install is in PATH... (!)
   Please add /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/bin to PATH.
   Otherwise you will get "command not found" errors upon running
   any Passenger commands.
   Learn more at about PATH at:
     https://www.phusionpassenger.com/library/indepth/environment_variables.html#the-path-environment-variable
 * Checking whether there are no other Passenger installations... ✓
 * Checking whether Apache is installed... ✓
 * Checking whether the Passenger module is correctly configured in Apache... ✓
Detected 0 error(s), 1 warning(s).
Press ENTER to continue.
似乎

通过乘客 github 快速搜索有所帮助......

union_station_hooks_core 和 union_station_hooks_rails 都是主乘客 Git 存储库中的 Git 子模块。 因此,修改我的 gemfile 以包含 submodules: true 将拉入所需的文件。

gem 'passenger', 
  git: 'https://github.com/FooBarWidget/passenger', 
  branch: 'stable-5.0', 
  submodules: true

我有同样的问题。这是因为您的乘客没有满员。全员乘客将通过制造。只需像这样下载所需的版本

wget http://s3.amazonaws.com/phusion-passenger/releases/passenger-5.0.26.tar.gz

并提取到/opt/passenger然后重新运行 passenger-install-nginx-module 并将其添加到 PATH -

echo 'PATH=/opt/passenger/bin:$PATH' >>etc/profile
PATH=/opt/passenger/bin:$PATH
export PATH
passenger-config validate-install

不要忘记在 http 部分中正确无误

http {
  ...
  passenger_root /opt/passenger;
  passenger_ruby /usr/bin/ruby;
  ...
}

最新更新