nourza
nourza

Reputation: 2321

cannot load such file -- gems/bundler-2.1.4/exe/bundle?

I got this error when I do bundle instal

bundle install /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' from /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.

Upvotes: 0

Views: 981

Answers (1)

MibraDev
MibraDev

Reputation: 1109

You have Bundler 2.1.4, and Rails 4.2 does not work with Bundler 2 and above.

You need to install a supported bundler version like this:

gem install bundler:1.17.3

To use the newly installed version run:

bundle _1.17.3_ install

Upvotes: 1

Related Questions