2

我有一个与Redmine 乘客错误类似的错误。我试图让 GitLab 与 Apache 和Passenger 一起工作,但没有运气。我被困在这个错误上:

无法加载此类文件 -- 捆绑器/设置 (LoadError)
      /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
      /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
      /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:219:in `block in run_load_path_setup_code'
      /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:333:in `running_bundler'
      /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:217:in `run_load_path_setup_code'
      /usr/share/passenger/helper-scripts/rack-preloader.rb:96:in `preload_app'
      /usr/share/passenger/helper-scripts/rack-preloader.rb:150:in `'
      /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `'
      /usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `'

按照 Andriy 的建议,我尝试使用以下命令安装 bundler gem:`

sudo gem install bundler

安装后我重新启动了 apache2 服务,但错误仍然存​​在。

VirtualHost 定义为:

<VirtualHost *:80>
        ServerName localhost

        # Point this to your public folder of gitlab
        DocumentRoot /home/git/gitlab/public
        <Directory /home/git/gitlab/public>
                Allow from all
                Options -MultiViews
        </Directory>

        PassengerRuby /usr/bin/ruby

        # Custom log file locations
        ErrorLog  /var/log/apache2/gitlab_error.log
        CustomLog /var/log/apache2/gitlab_access.log combined
</VirtualHost>
<Location /users/auth/shibboleth/callback>
  AuthType shibboleth
  ShibRequestSetting requireSession 1
  require valid-user
</Location>
<Location /Shibboleth.sso>
  SetHandler shib
</Location>

有人可以阐明这个问题吗?

4

2 回答 2

2

就我而言,附加到 apache 配置文件的行如下:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.24/buildout/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.24
PassengerDefaultRuby /usr/bin/ruby1.8

但是该应用程序使用 ruby​​ 2.0.0,因此在我在应用程序的 apache 虚拟主机配置文件中指定了不同的路径(使用“PassengerRuby”)后,错误得到了解决,如下所示:

("...虚拟主机 *:80>

服务器名称 www.yourhost.com

**PassengerRuby /home/user/.rvm/gems/ruby-2.0.0-p247**
  # !!! Be sure to point DocumentRoot to 'public'!
  DocumentRoot /somewhere/public    
  <Directory /somewhere/public>
     # This relaxes Apache security settings.
     AllowOverride all
     # MultiViews must be turned off.
     Options -MultiViews
  </Directory>

于 2013-11-15T21:55:31.293 回答
1

Yesterday I have had a very similar problem. I am running latest Redmine completely installed in a non-root function user account. I have all the gems to support Redmine (including bundler) installed in that account, too, obviously with a non-standard GEM_HOME of /home/www-adm/.gem-home.

Startup complained about not being able to load bundler; the error message was not quite the same, though:

*** Exception LoadError in PhusionPassenger::ClassicRails::ApplicationSpawner (no such file to load -- bundler) (process 166395, thread #<Thread:0x7fce7910b360>):

I could fix this by setting the GEM_HOME environment variable in the Redmine-related section of the Apache configuration, like this:

SetEnv GEM_HOME /home/www-adm/.gem-home

That doesn't mean the same (with the appropriate pathname for your own installation, of course) will help in your case, but it might be worth a try.

But maybe you just haven't installed bundler?

于 2014-07-22T10:21:18.390 回答