Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RVM Bundle Install Missing Gem Error even though gem is installed

People also ask

What is the difference between gem install and bundle install?

Almost seems like running 'gem install' adds it to the global available gems (and hence terminal can run the package's commands), whereas adding it to the gemfile and running bundle install only adds it to the application. Similar to npm install --global. that's basically it.

How do I resolve gem dependencies?

Common Attempts To Resolve Ruby Gem Dependencies Bundler can help to resolve dependencies when working with Ruby gems by allowing you to specify a set of gems in a Gemfile, then issue a single command to install them. Bundler then automatically resolves the dependencies for you.

Where is the gem file located?

The Gemfile is wherever you want it to be - usually in the main directory of your project and the name of the file is Gemfile . It's convenient to have one because it allows you to use Bundler to manage which gems and which versions of each your project needs to run.


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

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

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


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.


I had a similar issue. It turned out I didn't have a project specific .rvmrc file. I just created it using

rvm --rvmrc --create 1.9.3@my_project_name

In my project dir

This solved the issue


If you got to the bottom of this and are still banging your head against the wall...

My problem was that rvm install 1.8.7 failed late in the install but appeared to have been successful (I had ruby 1.8.7 and could create gemsets)

But it seems like $GEM_HOME is set late in the install script and since that wasn't set, rvm wasn't looking in the right spot for gems.

I ran rvm reinstall 1.8.7 and looked carefully for errors.

What tipped me off was this thread: https://groups.google.com/d/topic/rubyversionmanager/aUBDxbBzZpE/discussion

You can check to see if this is your problem by running

echo $GEM_HOME or gem env or checking your rvm install log (see link above)

Do you see your ruby version and gemset name in your Gem Path? If not, maybe the rvm install failed.


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.


Try this : https://rvm.io/integration/gnome-terminal/

it says about profiles run on startup, i am running ubuntu 12.10 and it work. Only thing you have to do is set "Run command as a login shell" in terminal profile preferences (tab title and command).

Hope it saves some time to someone.