Topic: (solved) ERRRO: Gem bundler is not installed, but it seems to be...

On a clean Rails 3.2 install on a clean Ubuntu 11.04 machine, Rails is working, but when I try:

$ bundle install

I get this error:

ERRRO: Gem bundler is not installed, run `gem install bundler` first.

I don't understand this -- because gem list shows bundler 1.0.22.

Here's my gem list:

actionmailer (3.2.1)
actionpack (3.2.1)
activemodel (3.2.1)
activerecord (3.2.1)
activeresource (3.2.1)
activesupport (3.2.1)
addressable (2.2.7)
arel (3.0.0)
builder (3.0.0)
bundler (1.0.22)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.2.0)
em-websocket (0.3.6)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.3.0)
ffi (1.0.11)
guard (1.0.0)
guard-livereload (0.4.0)
guard-rails (0.1.0)
guard-test (0.4.3)
heroku (2.20.1)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.1)
jquery-rails (2.0.0)
json (1.6.5)
launchy (2.0.5)
mail (2.4.1)
mime-types (1.17.2)
multi_json (1.0.4)
pg (0.13.1)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.1)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.1)
railties (3.2.1)
rake (0.9.2.2, 0.9.2)
rdoc (3.12)
rest-client (1.6.7)
rubyzip (0.9.6.1)
sass (3.1.15)
sass-rails (3.2.4)
sequel (3.20.0)
sinatra (1.0)
sprockets (2.1.2)
sqlite3 (1.3.5)
sqlite3-ruby (1.3.3)
taps (0.3.23)
term-ansicolor (1.0.7)
test-unit (2.4.7)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.31)
uglifier (1.2.3)

Here's the output of rvm info:

dow@ubuntu:~/rails3$ rvm info

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

ruby-1.9.2-head:

  system:
    uname:       "Linux ubuntu 2.6.38-13-generic #55-Ubuntu SMP Tue Jan 24 14:27:59 UTC 2012 i686 i686 i386 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.2.8(1)-release (i686-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]"
    updated:      "6 hours 2 minutes 32 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p316"
    date:         "2012-02-14"
    platform:     "i686-linux"
    patchlevel:   "2012-02-14 revision 34583"
    full_version: "ruby 1.9.2p316 (2012-02-14 revision 34583) [i686-linux]"

  homes:
    gem:          "/home/dow/.rvm/gems/ruby-1.9.2-head"
    ruby:         "/home/dow/.rvm/rubies/ruby-1.9.2-head"

  binaries:
    ruby:         "/home/dow/.rvm/rubies/ruby-1.9.2-head/bin/ruby"
    irb:          "/home/dow/.rvm/rubies/ruby-1.9.2-head/bin/irb"
    gem:          "/home/dow/.rvm/rubies/ruby-1.9.2-head/bin/gem"
    rake:         "/home/dow/.rvm/gems/ruby-1.9.2-head/bin/rake"

  environment:
    PATH:         "/home/dow/.rvm/gems/ruby-1.9.2-head/bin:/home/dow/.rvm/gems/ruby-1.9.2-head@global/bin:/home/dow/.rvm/rubies/ruby-1.9.2-head/bin:/home/dow/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    GEM_HOME:     "/home/dow/.rvm/gems/ruby-1.9.2-head"
    GEM_PATH:     "/home/dow/.rvm/gems/ruby-1.9.2-head:/home/dow/.rvm/gems/ruby-1.9.2-head@global"
    MY_RUBY_HOME: "/home/dow/.rvm/rubies/ruby-1.9.2-head"
    IRBRC:        "/home/dow/.rvm/rubies/ruby-1.9.2-head/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

Last edited by ddrake (2012-02-18 21:08:30)

Re: (solved) ERRRO: Gem bundler is not installed, but it seems to be...

I think I have this one figured out. smile  I had originally followed these instructions to do the clean Rails 3.2 install.  Those instructions worked really well, but in my case, these two steps:

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source .bash_profile

needed to be changed like this:

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc
source ~/.bashrc

... because I'm only executing non-login shells on my local ubuntu setup.   The echo command appends this to the shell startup script:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

Without that script, the necessary paths don't get setup, so even though bundler was installed, the script .rvm/bin/bundle didn't know where to find it.