【问题标题】:cannot load such file -- gems/bundler-2.1.4/exe/bundle?无法加载此类文件 -- gems/bundle-2.1.4/exe/bundle?
【发布时间】:2020-10-03 19:55:52
【问题描述】:

我在进行捆绑安装时遇到此错误

捆绑安装 /Users/nour/.rvm/gems/ruby-2.4.0/bin/bundle:23:in load': cannot load such file -- /Users/nour/.rvm/rubies/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/bundler-2.1.4/exe/bundle (LoadError) from /Users/nour/.rvm/gems/ruby-2.4.0/bin/bundle:23:in' 来自 /Users/nour/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:24:in eval' from /Users/nour/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:24:in'

rails g controller home
Your Gemfile lists the gem byebug (>= 0) more than once.
You should probably keep only one of them.
Remove any duplicate entries and specify the gem only once.
While it's not a problem now, it could cause errors if you change the version of one of them later.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 4.2.11.1) was resolved to 4.2.11.1, which depends on
      bundler (>= 1.3.0, < 2.0)

  Current Bundler version:
    bundler (2.1.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (>= 1.3.0, < 2.0)', which is required by gem 'rails (= 4.2.11.1)', in any of the sources.

【问题讨论】:

    标签: ruby-on-rails terminal bundle


    【解决方案1】:

    您有 Bundler 2.1.4,但 Rails 4.2 不适用于 Bundler 2 及更高版本。

    您需要像这样安装受支持的捆绑器版本:

    gem install bundler:1.17.3
    

    要使用新安装的版本运行:

    bundle _1.17.3_ install
    

    【讨论】:

    • 还是同样的问题
    • 运行:bundle _1.17.3_ install
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-10
    • 1970-01-01
    • 1970-01-01
    • 2013-02-20
    • 1970-01-01
    相关资源
    最近更新 更多