[英]LoadError: cannot load such file -- bundler/setup
We are upgrading to the latest ruby version (2.2.3) and latest rails version (4.2.4) and we can't get pass this error:我们正在升级到最新的 ruby 版本 (2.2.3) 和最新的 Rails 版本 (4.2.4),但无法通过此错误:
LoadError: cannot load such file -- bundler/setup
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
~/Documents/remsis/config/boot.rb:6:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
~/Documents/remsis/config/application.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
~/Documents/remsis/config/environment.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
~/Documents/remsis/config.ru:3:in `block in <main>'
~/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/builder.rb:4:in `instance_eval'
~/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/builder.rb:4:in `initialize'
~/Documents/remsis/config.ru:1:in `new'
~/Documents/remsis/config.ru:1:in `<main>'
~/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:51:in `eval'
~/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:51:in `load_config'
~/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:42:in `initialize'
~/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:12:in `new'
~/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/lib/nack/server.rb:12:in `run'
~/Library/Application Support/Pow/Versions/0.5.0/node_modules/nack/bin/nack_worker:4:in `<main>'
Create a Gemset with RVM使用 RVM 创建 Gemset
rvm use 2.2.3@yourproject --create
After that install bundler gem之后安装 bundler gem
gem install bundler
and last step is to do bundle install最后一步是进行捆绑安装
bundle install
The error shows you are using the system Ruby, not RVM.该错误表明您使用的是系统 Ruby,而不是 RVM。 You need to tell Pow to use the right Ruby version.
您需要告诉 Pow 使用正确的 Ruby 版本。 You need to create a
.rvmrc
file specifying which Ruby to use, and also create or edit a .powrc
or .powenv
file to tell Pow to load RVM.您需要创建一个
.rvmrc
文件来指定要使用的 Ruby,还需要创建或编辑.powrc
或.powenv
文件来告诉 Pow 加载 RVM。 See the Pow docs on using RVM .请参阅有关使用 RVM的Pow 文档。
If you are using / upgrading to bundler 2 then please check this documentation:如果您正在使用/升级到 bundler 2,请查看此文档:
https://bundler.io/guides/bundler_2_upgrade.html https://bundler.io/guides/bundler_2_upgrade.html
from my experience basically, you need to be on RubyGems v2.5.0 or above otherwise you will see cannot load such file -- bundler/setup
if you have require 'bundler/setup'
.根据我的经验,基本上,您需要使用 RubyGems v2.5.0 或更高版本,否则您将看到
cannot load such file -- bundler/setup
如果您require 'bundler/setup'
。 If you need to upgrade the rubygems you can do it by:如果您需要升级 rubygems,您可以通过以下方式进行:
gem update --system
hope it helps.希望能帮助到你。 Thanks
谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.