RVM Bundle Install Missing Gem Error even though gem is installed

Solution 1:

Adding the following (taken from .bash_profile) to .bashrc fixed it for me:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 

Solution 2:

I had the same problem with a clean install of RVM 1.10.3. After reinstalling I noticed that bundler is installed, and that <gemset>/bin directories are being added to my $PATH, but those bin directories don't actually exist. I think it's just an RVM bug.

As a quick fix I manually copied the bundle binary into an RVM bin dir that does exist. That seems to have fixed my problem:

$ cd ~/.rvm
$ cp gems/ruby-1.9.3-p0/gems/bundler-1.0.21/bin/bundle rubies/ruby-1.9.3-p0/bin/

The Ruby and Bundler versions in those paths will likely be different for you.


The solution above works however it was bugging me so I put it to the rvm guys; it turns out my ~/.gemrc file was overriding the gem location with this line:

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

Removing it fixed it for me. See here for full thread: https://github.com/wayneeseguin/rvm/issues/1043#issuecomment-7336267

Solution 3:

I had a similar problem, and the answer (at least for me) was maddeningly simple after lots of trial and error.

This is definitely a path issue, and @gamecreature's mentioning of path order was the crucial clue for me.

I'm not sure how it happened, but I had $HOME/.rvm/bin as the first item in my PATH export.

This is unnecessary as this directory gets added to the path in the correct order through sourcing the rvm file.

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

So my fix was just to remove $HOME/.rvm/bin from my PATH export.

If you have multiple init files (.bashrc, .bash_profile, .profile), make sure to follow the advice on the rvm troubleshooting page:

make sure that the sourcing of the rvm file occurs last in your profile files (.bash_profile / .bashrc / .zshrc) essentially after any customizations of PATH / functions or aliases.

But I'd also recommend checking the rest of your PATH definition to make sure there aren't any duplicates declared that would take precedence.