无法加载此类文件 - bundler / setup(loaderror) - Passenger / Apache2

时间:2015-11-17 02:27:44

标签: ruby-on-rails ruby apache2 debian passenger

我有跟随错误,似乎无法弄清楚原因以及如何解决它。

设置

  • Debian 8
  • Ruby 2.2.2(通过RVM安装)
  • RVM 1.26.11
  • Rails 4.2.4
  • 乘客5.0.21
  • Capistrano 3.4.0

乘客错误

    cannot load such file -- bundler/setup (LoadError)
    /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /usr/local/rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:430:in `activate_gem'
    /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:297:in `block in run_load_path_setup_code'
    /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:435:in `running_bundler'
    /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:296:in `run_load_path_setup_code'
    /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:100:in `preload_app'
    /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
    /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
    /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21/src/helper-scripts/rack-preloader.rb:29:in `<main>'

APP_NAME.conf

<VirtualHost *:80>
    ServerName HOSTNAME
    ServerAdmin sudo@localhost
    DocumentRoot /var/www/APP_NAME/current/public
    PassengerRoot /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.0.21
    RailsEnv qa
    <Directory /var/www/APP_NAME/current/public>
        AllowOverride all
        Options -MultiViews
    </Directory>
</VirtualHost>

Gem ENV

RubyGems Environment:
  - RUBYGEMS VERSION: 2.4.8
  - RUBY VERSION: 2.2.2 (2015-04-13 patchlevel 95) [armv7l-linux-eabihf]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-2.2.2
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-2.2.2/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-2.2.2/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/rvm/rubies/ruby-2.2.2/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - armv7l-linux
  - GEM PATHS:
     - /usr/local/rvm/gems/ruby-2.2.2
     - /usr/local/rvm/gems/ruby-2.2.2@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/rvm/gems/ruby-2.2.2/bin
     - /usr/local/rvm/gems/ruby-2.2.2@global/bin
     - /usr/local/rvm/rubies/ruby-2.2.2/bin
     - /usr/local/rvm/bin
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin

2 个答案:

答案 0 :(得分:2)

您是否检查过您的计算机上安装了bundler

我更喜欢rbenv到rvm而不是100%熟悉如何使用RVM安装bundler gem,但这article可能会有所帮助。

答案 1 :(得分:1)

我的安装中遇到了类似的错误,除了找不到预加载器,这就是问题所在。

我从apache-passenger安装程序安装了乘客并从源头安装了这个,所以它是最新的。

当我安装宝石时,我刚刚使用了宝石安装乘客,这是不是最新的。丢失的文件是在旧版本中,但不是在较新版本中,所以我最终不得不这样做 rsync -av --ignore-existing /path/to/passenger-out-of-date-folder/ /path/to/passenger-up-to-date-folder/