gpt4 book ai didi

rubygems - 无法加载此类文件 - 捆绑程序/安装程序(LoadError)

转载 作者:行者123 更新时间:2023-12-03 04:36:47 24 4
gpt4 key购买 nike

我正在使用 Ruby 2.0 设置 Rails 4 应用程序,但收到“Web 应用程序无法启动”并获取以下跟踪信息:

cannot load such file -- bundler/setup (LoadError)
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'
/usr/local/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.19/lib/phusion_passenger/loader_shared_helpers.rb:212:in `run_load_path_setup_code'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:96:in `preload_app'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:150:in `<module:App>'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/lib/ruby/gems/1.8/gems/passenger-4.0.19/helper-scripts/rack-preloader.rb:28:in `<main>'

我的 apache2.conf 是:

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.19/buildout/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.19
PassengerDefaultRuby /usr/local/bin/ruby

捆绑-v是:

Bundler version 1.3.5

ruby -v 是:

ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

gem env 是:

RubyGems Environment:
- RUBYGEMS VERSION: 2.1.5
- RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/lib/ruby/gems/1.8/bin
- SPEC CACHE DIRECTORY: /root/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /root/.gems/bin
- /usr/lib/ruby/gems/1.8/bin/
- /usr/local/bin
- /usr/bin
- /bin
- /usr/bin/X11
- /usr/games
- /usr/sbin
- /sbin

echo $GEM_PATH 是:

/usr/lib/ruby/gems/1.8:/usr/lib/ruby/gems/1.8

GEM_PATH不应该是/usr/lib/ruby/gems/2.0吗?

在 apache2.conf 的虚拟主机内我添加了:

SetEnv GEM_HOME /usr/lib/ruby/gems/1.8

现在它正在工作。

这是解决这个问题的正确方法吗?

最佳答案

我遇到了几乎完全相同的错误,并且只需运行即可完全修复它:

gem install bundler

您的捆绑程序安装可能已损坏或丢失 - 这就是我的情况。请注意,如果上述方法失败,您可以尝试:

sudo gem install bundler

...但一般来说你可以不用 sudo 来完成。

关于rubygems - 无法加载此类文件 - 捆绑程序/安装程序(LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19061774/

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