I'm getting the following error even though I currently do have the Bundler gem installed (it appears when I run $gem list).
ERROR: Gem bundler is not installed, run `gem install bundler` first.
I'm using RVM and my $PATH is as follows:
/Users/cjstingl/.rvm/gems/ruby-1.9.2-p290@rails3tutorial2ndEd/bin:
/Users/cjstingl/.rvm/gems/ruby-1.9.2-p290@global/bin:
/Users/cjstingl/.rvm/rubies/ruby-1.9.2-p290/bin:
/Users/cjstingl/.rvm/bin:
/Users/cjstingl/.bin:
/usr/local/sbin:
/usr/local/Cellar/php/5.3.6/bin:
/usr/local/share/python:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/X11/bin
Also this is my gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.15
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.2.0]
- INSTALLATION DIRECTORY: /Users/cjstingl/.rvm/gems/ruby-1.9.2-p290@rails3tutorial2ndEd
- RUBY EXECUTABLE: /Users/cjstingl/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /Users/cjstingl/.rvm/gems/ruby-1.9.2-p290@rails3tutorial2ndEd/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/cjstingl/.rvm/gems/ruby-1.9.2-p290@rails3tutorial2ndEd
- /Users/cjstingl/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => false
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "-n/usr/local/bin --no-ri --no-rdoc --no-user-install"
- REMOTE SOURCES:
- http://rubygems.org/
Also: Using the bundle -v command returns the same error
I've tried imploding RVM and reinstalling which doesn't seem to work. I'm stumped and any help would be appreciated.
I installed ruby 1.9.3 by rvm. After git octopress completed, just edit $path_of_git/.rvmrc like this "rvm use 1.9.3". AND THEN run command of "cd ..; cd $path_of_git". After that it will ask you weather trust the .rvmrc or not. Type 'y' to make .rvmrc file work.
For my setup, adding the user that apache runs as to the rvm group worked
This works for me when I specify the version of Ruby I want to use:
Adding the following (taken from .bash_profile) to .bashrc fixed it for me:
Ran into this problem myself after updating my Ruby patch level. I ran
which gem
and discovered that it was using a global version of rubygems, in this case the path was~/.rvm/bin/gem
. So I ranrvm rubygems current
, which installed it in~/.rvm/rubies/ruby-1.8.7-p370/bin/gem
. Rangem install bundler
andbundle
again. Problem solved.I don't know if it's the cause of your problem. But I had a similar problem. The reason was that my RVM environment wasn't correctly.
I had 2 users, one which was working one that didn't. The working user used the following bundle script. (output from: which bundle)
/home/rvm/.rvm/gems/ruby-1.9.3-p0/bin/bundle
The wrong rvm-installation user used:
/home/user/.rvm/bin/bundle
The reason for this is the wrong $PATH order. The .rvm/gems/ruby-.../bin path should be placed before the ./rvm/bin path.
In my situation the cause was I set the $PATH variable to a rvm of another user. I fixed the issue by adding a symbolic link to the RVM of the user and changing my path from:
/home/rvm/.rvm/bin
to
/home/user/.rvm/bin
When the code above does not work for you, you can manually adjust the path just AFTER loading rvm.