Bundler: Command not found

I did this (Ubuntu latest as of March 2013 [ I think :) ]):

sudo gem install bundler

Credit goes to Ray Baxter.

If you need gem, I installed Ruby this way (though this is chronically taxing):

mkdir /tmp/ruby && cd /tmp/ruby
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
tar xfvz ruby-1.9.3-p327.tar.gz
cd ruby-1.9.3-p327
./configure
make
sudo make install

My problem was that I did:

sudo gem install bundler

So I had installed as root rather than as myself. So I uninstalled as root, then installed as myself:

sudo gem uninstall bundler
gem install bundler
rbenv rehash

(last command for if you are using rbenv)

And it worked. The "correct" path was in .bashrc (or other shell profile), at least according to

$PATH
=> zsh: /Users/myself/.rbenv/shims:/Users/myself/.rbenv/bin: ... etc

but it was expecting it to be installed for myself - not for root. In my case, its rightful installation place is in ~/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler


You need to add the ruby gem executable directory to your path

export PATH=$PATH:/opt/ruby-enterprise-1.8.7-2010.02/bin

... also for Debian GNU/Linux 6.0 :)

export PATH=$PATH:/var/lib/gems/1.8/bin