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

Closed
kule opened this Issue Jul 11, 2012 · 20 comments

Comments

Projects
None yet
6 participants

kule commented Jul 11, 2012

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 was assigned Jul 23, 2012

Owner

mpapis commented Jul 23, 2012

show output of the following:

echo $GEM_HOME
echo $GEM_PATH
echo $PATH
which bundle

kule commented Jul 28, 2012

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
Owner

mpapis commented Jul 28, 2012

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 commented Jul 28, 2012

→ 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
Owner

mpapis commented Jul 28, 2012

please show output of:

gem env

kule commented Jul 28, 2012

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
Owner

mpapis commented Jul 28, 2012

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 closed this Jul 28, 2012

kule commented Jul 28, 2012

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

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.

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

Owner

mpapis commented Apr 3, 2013

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

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! 😸

noAlvaro commented May 2, 2013

@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!

Owner

mpapis commented May 2, 2013

@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 commented May 2, 2013

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

Owner

mpapis commented May 2, 2013

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 commented May 2, 2013

Just created the new ticket, thank you.

parag90 commented Jan 3, 2017 edited

Hey @mpapis
After reading all the comments above I am thanking you in advance for the solution I am asking.

I am facing same issue. When everever I am running test from my rubymine it says bundler missing
Here are my env details

DELC02PQ5TNG8WN:cucumber pajain$ echo $GEM_HOME
/Users/pajain/.rvm/gems/ruby-2.2.6

DELC02PQ5TNG8WN:cucumber pajain$ echo $GEM_PATH
/Users/pajain/.rvm/gems/ruby-2.2.6:/Users/pajain/.rvm/gems/ruby-2.2.6@global

DELC02PQ5TNG8WN:cucumber pajain$ echo $PATH
/Users/pajain/.rvm/gems/ruby-2.2.6/bin:/Users/pajain/.rvm/gems/ruby-2.2.6@global/bin:/Users/pajain/.rvm/rubies/ruby-2.2.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/pajain/apache-maven-3.3.3/bin:/Users/pajain/office/ADB:/Users/pajain/Downloads:/Users/pajain/.rvm/bin

DELC02PQ5TNG8WN:cucumber pajain$ which bundle
/Users/pajain/.rvm/gems/ruby-2.2.6/bin/bundle

DELC02PQ5TNG8WN:cucumber pajain$ gem env
Failed to load /Users/pajain/.gemrc because it doesn't contain valid YAML hash
RubyGems Environment:

  • RUBYGEMS VERSION: 2.6.8
  • RUBY VERSION: 2.2.6 (2016-11-15 patchlevel 396) [x86_64-darwin15]
  • INSTALLATION DIRECTORY: /Users/pajain/.rvm/gems/ruby-2.2.6
  • USER INSTALLATION DIRECTORY: /Users/pajain/.gem/ruby/2.2.0
  • RUBY EXECUTABLE: /Users/pajain/.rvm/rubies/ruby-2.2.6/bin/ruby
  • EXECUTABLE DIRECTORY: /Users/pajain/.rvm/gems/ruby-2.2.6/bin
  • SPEC CACHE DIRECTORY: /Users/pajain/.gem/specs
  • SYSTEM CONFIGURATION DIRECTORY: /Users/pajain/.rvm/rubies/ruby-2.2.6/etc
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-darwin-15
  • GEM PATHS:
    • /Users/pajain/.rvm/gems/ruby-2.2.6
    • /Users/pajain/.rvm/gems/ruby-2.2.6@global
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:
  • SHELL PATH:
    • /Users/pajain/.rvm/gems/ruby-2.2.6/bin
    • /Users/pajain/.rvm/gems/ruby-2.2.6@global/bin
    • /Users/pajain/.rvm/rubies/ruby-2.2.6/bin
    • /usr/local/bin
    • /usr/bin
    • /bin
    • /usr/sbin
    • /sbin
    • /Users/pajain/apache-maven-3.3.3/bin
    • /Users/pajain/office/ADB
    • /Users/pajain/Downloads
    • /Users/pajain/.rvm/bin

DELC02PQ5TNG8WN:gems pajain$ ls -l /Users/pajain/.rvm/gems/ruby-2.2.6/bin/bundle
-rwxr-xr-x 1 pajain SEA\Domain Users 501 Jan 3 17:23 /Users/pajain/.rvm/gems/ruby-2.2.6/bin/bundle
DELC02PQ5TNG8WN:gems pajain$ ls -l /Users/pajain/.rvm/gems/ruby-2.2.6@global/bin/bundle
-rwxr-xr-x 1 pajain SEA\Domain Users 501 Jan 3 17:20 /Users/pajain/.rvm/gems/ruby-2.2.6@global/bin/bundle
DELC02PQ5TNG8WN:gems pajain$

@mpapis I had --no-document entry in .gemrc file which I removed it but still issue exists

Owner

mpapis commented Jan 3, 2017

@parag90 make sure rubymine is configured to use ruby-2.2.6 without a gemset - if this does not help - open a new ticket ... or ask on stackoverflow

parag90 commented Jan 4, 2017

@mpapis created issue #3864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment