gpt4 book ai didi

ruby-on-rails - 乘客 bundler /设置 LoadError

转载 作者:数据小太阳 更新时间:2023-10-29 08:48:40 25 4
gpt4 key购买 nike

我有一个与 Redmine passenger error 类似的错误.我试图让 GitLab 与 Apache 和 Passenger 一起工作,但没有运气。我被这个错误困住了:

 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

安装后我重新启动了 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>

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

最佳答案

在我的例子中,附加到 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>

关于ruby-on-rails - 乘客 bundler /设置 LoadError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19544564/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com