Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

ERROR: Gem bundler is not installed, run `gem install bundler` first. #1043

Closed
kule opened this Issue · 17 comments

5 participants

@kule

I keep having this issue even with a fresh install is it a known problem?

I can get around it by copying/symlinking to the bundle file as per this answer:

http://stackoverflow.com/a/9070597/233004

All the rubies (1.8.7, 1.9.2, 1.9.3) seem to compile & install correctly but they all come up with this error.

Is this just because of running with the latest XCode (4.3.3)? I'm running on 10.7.4.

Here's my PATH:

/Users/luke/.rvm/gems/ruby-1.9.3-p194@gem-portal/bin:/Users/luke/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/luke/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/luke/.rvm/bin:/Users/luke/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

@mpapis mpapis was assigned
@mpapis
Collaborator

show output of the following:

echo $GEM_HOME
echo $GEM_PATH
echo $PATH
which bundle
@kule

Sorry for the late reply - this is just after an rvm stable install, installed ruby 1.9.3, and sitting in a gemset project (rvm use 1.9.3@gem-portal) EDIT: Oh Incase it matters I've done gem install bundler too.

→ echo $GEM_HOME
/Users/luke/.rvm/gems/ruby-1.9.3-p194

→ echo $GEM_PATH
/Users/luke/.rvm/gems/ruby-1.9.3-p194:/Users/luke/.rvm/gems/ruby-1.9.3-p194@global

echo $PATH
/Users/luke/.rvm/gems/ruby-1.9.3-p194/bin:/Users/luke/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/luke/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/luke/.rvm/bin:/Users/luke/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar/android-sdk/r18/platform-tools/

which bundle
/Users/luke/.rvm/bin/bundle
@mpapis
Collaborator

try:

ls -l /Users/luke/.rvm/gems/ruby-1.9.3-p194/bin/bundle /Users/luke/.rvm/gems/ruby-1.9.3-p194@global/bin/bundle
@kule
→ ls -l /Users/luke/.rvm/gems/ruby-1.9.3-p194/bin/bundle /Users/luke/.rvm/gems/ruby-1.9.3-p194\@global/bin/bundle
ls: /Users/luke/.rvm/gems/ruby-1.9.3-p194/bin/bundle: No such file or directory
ls: /Users/luke/.rvm/gems/ruby-1.9.3-p194@global/bin/bundle: No such file or directory

FYI bundle does exist here:

gems/ruby-1.9.3-p194\@global/gems/bundler-1.1.5/bin/bundle
@mpapis
Collaborator

please show output of:

gem env
@kule
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-darwin12.0.0]
  - INSTALLATION DIRECTORY: /Users/luke/.rvm/gems/ruby-1.9.3-p194@gem-portal
  - RUBY EXECUTABLE: /Users/luke/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/luke/.rvm/gems/ruby-1.9.3-p194@gem-portal/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-12
  - GEM PATHS:
     - /Users/luke/.rvm/gems/ruby-1.9.3-p194@gem-portal
     - /Users/luke/.rvm/gems/ruby-1.9.3-p194@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => false
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
     - "gem" => "-n/usr/local/bin"
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com
@mpapis
Collaborator

and this gives you answer why bundle could not be found, you explicitly overwrite location for gem binaries with:

    - "gem" => "-n/usr/local/bin"

remove it from ~/.gemrc or /etc/gemrc and reinstall all gems:

rvm get head # neaded for the next command:
rvm all-gemsets do rvm gemset pristine

It will reinstall all gems and report to you if any of them could not be reinstalled.

@mpapis mpapis closed this
@kule

Sweet that's fixed it. Many thanks for your time in helping to track this down, very much appreciated.

@dawnbuie

OMG that fixed it. 1.5 days later. How did this line get in my ~/.gemrc?

"gem" => "-n/usr/local/bin"

And thank you to all above for figuring it out.

@justinforce

I'm having this problem since 1.19.0 came out. When I open a new shell, I'm told bundler isn't installed until I use RVM to select a ruby or reload itself.

Selecting ruby 1.9.3

enzo:~% bundle --version
ERROR: Gem bundler is not installed, run `gem install bundler` first.
enzo:~% rvm 1.9.3
enzo:~% bundle --version
Bundler version 1.3.4

Selecting ruby 2.0.0

enzo:~% bundle --version
ERROR: Gem bundler is not installed, run `gem install bundler` first.
enzo:~% rvm 2.0.0
enzo:~% bundle --version
Bundler version 1.3.4

Reloading RVM

enzo:~% bundle --version
ERROR: Gem bundler is not installed, run `gem install bundler` first.
enzo:~% rvm reload
RVM reloaded!
enzo:~% bundle --version
Bundler version 1.3.4

Environment info and reloading RVM

Some newlines added for readability.

enzo:~% bundle --version
ERROR: Gem bundler is not installed, run `gem install bundler` first.

enzo:~% gem list bundler

*** LOCAL GEMS ***

bundler (1.3.4)

enzo:~% gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.25
  - RUBY VERSION: 1.9.3 (2013-02-22 patchlevel 392) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/force/.rvm/gems/ruby-1.9.3-p392
  - RUBY EXECUTABLE: /home/force/.rvm/rubies/ruby-1.9.3-p392/bin/ruby
  - EXECUTABLE DIRECTORY: /home/force/.rvm/gems/ruby-1.9.3-p392/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/force/.rvm/gems/ruby-1.9.3-p392
     - /home/force/.rvm/gems/ruby-1.9.3-p392@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-rdoc --no-ri"
     - :sources => ["http://rubygems.org"]
  - REMOTE SOURCES:
     - http://rubygems.org

enzo:~% echo $GEM_HOME
/home/force/.rvm/gems/ruby-1.9.3-p392

enzo:~% echo $GEM_PATH
/home/force/.rvm/gems/ruby-1.9.3-p392:/home/force/.rvm/gems/ruby-1.9.3-p392@global

enzo:~% echo $PATH
/home/force/code/ric/src:/home/force/code/ric/tools:/usr/local/heroku/bin:/usr/local/rvm/bin:/home/force/.rvm/bin:/home/force/bin:/home/force/.rvm/gems/ruby-1.9.3-p392/bin:/home/force/.rvm/gems/ruby-1.9.3-p392@global/bin:/home/force/.rvm/rubies/ruby-1.9.3-p392/bin:/home/force/.rvm/bin:/home/force/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
enzo:~% which -a bundle
/home/force/.rvm/bin/bundle
/home/force/.rvm/gems/ruby-1.9.3-p392@global/bin/bundle
/home/force/.rvm/bin/bundle

enzo:~% rvm reload
RVM reloaded!

enzo:~% bundle --version
Bundler version 1.3.4

Loading RVM

I use the same script to load RVM on my own machine as I do on a machine with global RVM. In all of my examples, I am loading it from my home directory.

for location in $HOME/.rvm /usr/local/rvm; do
  source $location/scripts/rvm 2>/dev/null
  export PATH=$location/bin:$PATH
done

Linux Containers (LXC)

With a fresh install in LXC, I do not get this behavior. So I guess I'm interested in troubleshooting this very mysterious problem. I'm not convinced it's a bug (more likely it's just my environment), but it is pretty obnoxious. I would really appreciate any help I can get.

Thanks!

Justin

@mpapis
Collaborator

the issue is with the second line of your custom code, it is not required:

for location in $HOME/.rvm /usr/local/rvm
do
  if
    [[ -f $location/scripts/rvm ]]
  then
    source $location/scripts/rvm
    break
  fi
done
@justinforce

Thanks @mpapis! That was definitely the problem. Replaced with

for location in $HOME/.rvm /usr/local/rvm; do
  [ -e $location ] && source $location/scripts/rvm
done

You're my hero! :smile_cat:

@noAlvaro

@mpapis, maybe you will want help me too :D. I'm lost with that for 2 days already, and I think it is similar issue of (...) bundler is never installed (...). The error started happening when I tried to setup a new rvm environment with a lower version of Ruby (1.9.2-p290).

Mountain Lion here, my configs are:

echo $GEM_HOME
/Users/alvaro/.rvm/gems/ruby-1.9.2-p290@heroku_clicaco
echo $GEM_PATH
/Users/alvaro/.rvm/gems/ruby-1.9.2-p290@heroku_clicaco:/Users/alvaro/.rvm/gems/ruby-1.9.2-p290@global
echo $PATH
/Users/alvaro/.rvm/gems/ruby-1.9.2-p290@heroku_clicaco/bin:/Users/alvaro/.rvm/gems/ruby-1.9.2-p290@global/bin:/Users/alvaro/.rvm/rubies/ruby-1.9.2-p290/bin:/Users/alvaro/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
which bundle
/Users/alvaro/.rvm/bin/bundle
gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.9.3 (2012-11-10 patchlevel 327) [x86_64-darwin12.2.0]
  - INSTALLATION DIRECTORY: /Users/alvaro/.rvm/gems/ruby-1.9.3-p327
  - RUBY EXECUTABLE: /Users/alvaro/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/alvaro/.rvm/gems/ruby-1.9.3-p327/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-12
  - GEM PATHS:
     - /Users/alvaro/.rvm/gems/ruby-1.9.3-p327
     - /Users/alvaro/.rvm/gems/ruby-1.9.3-p327@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Any help would be appreciated.
Thanks!

@mpapis
Collaborator

@noAlvaro you need to run:

gem install bundler

if the problem persist please open a new ticket for it, this one was fixed long time ago

@noAlvaro

Yeah, yeah.. that's the problem. Still not working after gem install bundler.
Thanks.

@mpapis
Collaborator

can you please open a new ticket, include which bundle, and ls -l /Users/alvaro/.rvm/gems/ruby-1.9.3-p327/bin/bundle.

@noAlvaro

Just created the new ticket, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.