Skip to content
bundler: command not found

bundler: command not found

DodaTech 3 min read

bundler: command not found means the bundle executable isn’t on your PATH — Bundler needs to be installed as a gem before you can use it.

What It Means

Bundler is a Ruby gem that manages application dependencies by reading a Gemfile and resolving compatible versions. Unlike gem, which comes bundled with Ruby, Bundler is a separate gem that must be installed explicitly. When you type bundle install and get “command not found”, it means the bundle executable isn’t on your PATH.

Why It Happens

  • Bundler isn’t installed — it’s not bundled with Ruby by default in all setups.
  • Bundler is installed for a different Ruby version (via rbenv or RVM) than the one currently active.
  • The gem binaries directory isn’t in your PATH.
  • You installed Bundler globally but your Bundler user directory isn’t on PATH.
  • The bundler gem installation failed or was interrupted.

How to Fix It

Step 1: Install Bundler

This is the most common fix:

gem install bundler

If you get a permission error, you may need:

sudo gem install bundler  # Not recommended — use rbenv/RVM instead

Or with a version manager:

# With rbenv — gems install per Ruby version automatically
gem install bundler
rbenv rehash  # Make shims available

Step 2: Verify the installation

bundler --version
# Or
bundle --version

Both bundler and bundle commands should work.

Step 3: Check your PATH

If Bundler is installed but not found:

gem environment gemdir
# Example output: /home/user/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0

ls $(gem environment gemdir)/bin
# Check if 'bundle' and 'bundler' are there

If the gem bin directory isn’t in your PATH, add it:

echo 'export PATH="$PATH:$(ruby -e "puts Gem.bindir")"' >> ~/.bashrc
source ~/.bashrc

Step 4: Make sure you’re using the correct Ruby version

ruby --version
# If you switched Ruby versions, reinstall Bundler:
rbenv global 3.3.0
gem install bundler

Step 5: Run bundle install in your project

Once Bundler is available:

cd your-project
bundle install
What is the difference between gem install and bundle install?
gem install bundler installs the Bundler gem itself so the bundle command is available. bundle install (run inside a project) reads the Gemfile and installs all the gems your application needs. Think of it as installing the installer first, then using it to install everything else.
Why does Bundler work in one project but not another?
Each project may require a different Bundler version. Check the Gemfile.lock — it pins the Bundler version at the bottom (BUNDLED WITH). If you have Bundler 2.3 installed but the project needs 2.5, run gem install bundler -v 2.5. Use bundler -v to check your current version.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro