简体   繁体   中英

Passenger bundler/setup LoadError

I have a similar error to Redmine passenger error . I'm trying to get GitLab working with Apache and Passenger with no luck. I'm stuck on this error:

cannot load such file -- bundler/setup (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 `'

Following Andriy's suggestion I've tried to install bundler gem with: `

sudo gem install bundler

after installation I've restarted apache2 service but the error remains the same.

VirtualHost is defined with:

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

Can someone shed some light on this issue?

In my case, the lines appended to the apache config file were as follows:

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

But the app uses ruby 2.0.0 so the error was resolved after I specified a different path (using 'PassengerRuby'), within the apache virtual host config file for the app as follows:

("...VirtualHost *:80>

ServerName 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>

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 ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM