Rails: "Could not find bundler" (2.2.11) required by Gemfile.lock. (Gem::GemNotFoundException)

111,034

Solution 1

Make sure you're entering "bundle" update, if you have the bundler gem installed.

bundle update

If you don't have bundler installed, do gem install bundler.

Solution 2

I had this problem, then I did:

gem install bundler

then in your project folder do:

bundle install

and then you can run your project using:

bundle exec rails server

Solution 3

I had the same problem. This worked for me:

  1. run rvm/script/rvm and also add it to your .profile or .bash_profile as shown in https://rvm.io/rvm/install/

  2. use bundle without sudo

Solution 4

If You are using rvm, then try the following command:

rvmsudo gem install bundler

According to another question: Could not find rails (>= 0) amongst [] (Gem::LoadError)

Hope it helped, Cheers

Solution 5

The command is bundle update (there is no "r" in the "bundle").

To check if bundler is installed do : gem list bundler or even which bundle and the command will list either the bundler version or the path to it. If nothing is shown, then install bundler by typing gem install bundler.

Share:
111,034

Related videos on Youtube

Steven
Author by

Steven

Updated on July 08, 2022

Comments

  • Steven
    Steven 3 months

    When I try to do bundler update I get this error:

    .rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in
    `to_specs': Could not find bundler (>= 0) amongst
    [rake-0.8.7, rake-0.8.7, rubygems-update-1.8.4] (Gem::LoadError)
    

    I'm new to Ruby, can someone tell me what would cause this? Rake 0.8.7 is installed.

  • rmurphey
    rmurphey about 10 years
    Thanks for this. While I knew how to spell "bundle" vs "bundler", I'd completely forgotten that I reinstalled zsh and in the process accidentally blew this line away from my .zshrc. Had been pulling my hair out over this for a while :)
  • AMIC MING
    AMIC MING over 9 years
    if you create a new applocation - rails new and if you get this error?
  • ardavis
    ardavis over 9 years
    Do a gem list bundler and see if it shows up. If it does not, you need to install it as listed in my answer.
  • Don Cote
    Don Cote over 9 years
    gem install bundle -- this did it for me as well.
  • NRR
    NRR over 6 years
    This happened for me after installing a new version of ruby using rvm. Then I had to run gem install bundler again
  • sealocal
    sealocal about 6 years
    Notice that the "bundle" gem is simply a gem that declares "bundler" as a dependency, which essentially fixes your typo. github.com/will/bundle/blob/…
  • jonnyjava.net
    jonnyjava.net almost 6 years
    This answer is old but for me has been the solution!
  • rmcsharry
    rmcsharry almost 4 years
    Make sure this is the LAST line in your profile file
  • collimarco
    collimarco about 1 year
    You may also need to run bundle update --bundler (e.g. to upgrade from bundler v1 to v2)

Related