RVM Bundle Install Missing Gem Error, even if gem is installed

I get the following error, even though I currently have a Bundler gem installed (appears when I run the $ gem list).

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

I am using RVM, and my $ PATH looks like this:

 /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 bundle -v command returns the same error

I tried to blow up the RVM and reinstall, which does not seem to work. I'm at a standstill and any help would be appreciated.

+55
rubygems rvm bundler
Jan 24 2018-12-12T00:
source share
19 answers

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

 [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
+93
Mar 17 '12 at 20:19
source share

I had the same problem with a clean install of RVM 1.10.3. After reinstalling, I noticed that the package was installed, and that the <gemset> / bin directories are added to my $ PATH, but these bin directories do not actually exist. I think this is just an RVM error.

As a quick fix, I manually copied the bundle binary into the RVM bin directory that exists. This seems to fix 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 options for Ruby and Bundler in these paths are likely to be different for you.




The solution above works, but it pushed me, so I put it in rvm guys; it turned out that my ~ / .gemrc file overrides the location of the gem with this line:

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

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

+19
Jan 30 2018-12-12T00:
source share

I had a similar problem and the answer (at least for me) was insanely simple after many trial and error.

This is definitely a path issue, and @gamecreature mentioning the order of the path was the key for me.

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

This is optional, as this directory is added to the path in the correct order by searching for the rvm file.

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

So, I decided to remove $HOME/.rvm/bin from my PATH export.

If you have multiple initialization files (.bashrc, .bash_profile, .profile), be sure to follow the tips on the rvm troubleshooting page:

make sure that the source of the rvm file is found last in your profile files (.bash_profile / .bashrc / .zshrc) essentially after any PATH / function or alias settings.

But I would also recommend checking the rest of your PATH definition to make sure there are no declared duplicates that will take precedence.

+10
Jun 30 2018-12-12T00:
source share

I had a similar problem. It turned out that I did not have a specific project file .rvmrc. I just created it using

 rvm --rvmrc --create 1.9.3@my_project_name 

In my dir project

This solved the problem.

+7
Sep 08 '12 at 19:36
source share

If you get to the end and still bang your head on the wall ...

My problem was that rvm install 1.8.7 failed to complete the installation, but it seemed to be successful (I had ruby ​​1.8.7 and I could create a gemset)

But it looks like $GEM_HOME installed at the end of the script installation, and since it was not installed, rvm was not looking for the right place for the gems.

I ran rvm reinstall 1.8.7 and carefully looked at the errors.

What knocked me over was this topic: https://groups.google.com/d/topic/rubyversionmanager/aUBDxbBzZpE/discussion

You can check if this is your problem by running

echo $GEM_HOME or gem env or check your rvm installation log (see link above)

Do you see your ruby ​​version and gemset name in your Gem Path? If not, rvm installation may fail.

+5
Feb 06 '13 at 1:22
source share

I do not know if this is the cause of your problem. But I had a similar problem. The reason is that my RVM environment was wrong.

I had 2 users, one of whom worked, who did not. The working user used the following script package. (way out: which bundle)

/home/rvm/.rvm/gems/ruby-1.9.3-p0/bin/bundle

Invalid rvm installation user:

/home/user/.rvm/bin/bundle

The reason for this is the wrong order of $ PATH. The path .rvm / gems / ruby ​​-... / bin should be placed in front of the path. / rvm / bin.

In my situation, the reason was because I set the $ PATH variable to rvm of another user. I fixed the problem by adding a symlink to the user's RVM and changing my path:

/home/rvm/.rvm/bin

to

/home/user/.rvm/bin

If the code above does not work for you, you can manually adjust the path only after loading rvm.

+4
Jan 30 2018-12-12T00:
source share

Try the following: https://rvm.io/integration/gnome-terminal/

it talks about profiles running at startup, i run ubuntu 12.10 and it works. The only thing you need to do is set "Run the command as an input shell" in the terminal profile settings (name and tab command).

Hope this helps someone.

+4
Nov 08
source share

This happened to me, after switching to a new empty gemset and running gem install bundler . The reason is that the shell “remembers” the last bundle executable you used. To fix this (at least with bash ratings):

 hash -r 
+3
Mar 22 '12 at 19:17
source share

You know that this is obviously your problem with the PATH variable.

You must make sure which bundle will be like /usr/local/rvm/gems/ruby-1.9.3-p194/bin/bundle instead of something like /usr/local/rvm/bin/bundle .

hint:

Did you just use PATH = some explicit list in your .zshrc file?

Then you should change this to PATH = $ PATH: some list

+3
Apr 24 2018-12-12T00:
source share

I installed ruby ​​1.9.3 on rvm. After octopress completes, simply edit $ path_of_git / .rvmrc like this is "rvm use 1.9.3". And then enter the command "cd ..; cd $ path_of_git". After that, he will ask you to trust the weather .rvmrc or not. Type 'y' for the .rvmrc file to work.

+2
May 25 '12 at 11:12
source share

I had a very similar problem for a slightly different reason. In my home directory there was a .gemrc file left over from an old ruby ​​installation, and I skipped when deleting old files. Gem seems to be misleading the rvm settings with the settings in this file. As soon as I deleted it (and some files were installed in the same place), everything worked fine.

+2
Jun 17 2018-12-12T00:
source share

Today I faced the same problem. The approach I used to solve the problem was as follows:

1) Run

 cap shell 

on the same computer that you usually start at startup. Then do

 env | sort 

Executes a command on a remote server. Copy and paste the output into a local text file, for example. capenv.txt

2) SSH to the same remote server and run the same command, namely env | Sort. Save this locally as a text file, for example. sshenv.txt

3) Separate the two files and see what is in sshenv.txt, which is not in the capenv.txt file - this is most likely where your problem is.

 < ++CAP ++ < _=/bin/sh --- > ++ SSH ++ > __array_start=0 14a15 > PS1=\[\e]2;tracker@charlotte\a\e[0;31m LIVE:\u@\h \w> \e[0m 18d18 < rvm_env_string=ruby-1.9.3-p194 21d20 < rvm_ruby_string=ruby-1.9.3-p194 27c26,28 < USER=tracker \ No newline at end of file --- > USER=tracker > USES_BASHRC=bashrc > _=/usr/bin/env 

4) I immediately noticed that the shell interpreter was not installed on bash. This can be fixed by adding

 set :shell, '/usr/bin/bash' 

to the deploy.rb file. This solved my problem.

+2
Sep 10
source share

After installing RVM on several machines with the same setup and problems with RVM on one, but not having these problems on the other, I decided to look for something better, less error prone.

I found and switched to rbenv , which is much simplified than RVM.

And as the README rbenv says:

rbenv does ...

  • Allows you to change the global version of Ruby for each user.
  • Provide support for Ruby versions for each project .
  • Allow overriding the Ruby version using an environment variable.

Unlike rvm, rbenv does not ...

  • You need to boot into your shell. Instead, the rbenv shim approach works by adding a directory to your $ PATH.
  • Cancel shell commands such as cd. . This is dangerous and error prone.
  • You have a configuration file. You do not need to configure anything except the version of Ruby that you want to use.
  • Install Ruby. You can create and install Ruby yourself or use ruby-build to automate the process.
  • Office gemset. Bundler is the best way to manage application dependencies. If you have projects that do not yet use the Bundler, you can install the rbenv-gemset plugin .
  • Require changes to the Ruby libraries for compatibility. The simplicity of rbenv means that if you are in $ PATH, you should know nothing more about this.
  • Prompt you when switching to a project. Instead of executing arbitrary code, rbenv reads only the version name from each project. There is nothing to “trust”.

So, if you ask me, reset the RVM and switch to rbenv.

+2
Oct 31 '12 at 11:27
source share

This works for me when I specify the version of Ruby that I want to use:

 $ rvm use 1.9.2-p290 Using /Users/myname/.rvm/gems/ruby-1.9.2-p290 
+1
May 04 '12 at 2:56
source share

Please fix this problem yourself after updating my Ruby fix level. I ran which gem and found that it was using the global version of rubygems, in which case the path was ~/.rvm/bin/gem . So I ran rvm rubygems current , which set it to ~/.rvm/rubies/ruby-1.8.7-p370/bin/gem . Ran gem install bundler and bundle again. The problem is resolved.

+1
Sep 14 '12 at 22:28
source share

I had the same problem when I had an empty .rvmrc file in the directory I switched to (rvm 1.15.1). Obviously, there are many reasons for this error.

0
Aug 15 '12 at 12:28
source share

Enter the same problem (where I continued to install the distribution, but rvm did not recognize it) on one of my laptops. I guessed that I might have installed RVM incorrectly while I was still noob rails. I tried the solution above, but that did not work for me. After messing with him, I gave up and uninstalled RVM and reinstalled it. I figured this was due to some kind of weird configuration problem deeply nested somewhere or. Here are the steps I took:

Remove RVM:

 rvm implode 

Install RVM again:

 curl -L https://get.rvm.io | bash -s stable --rails rvm reload 

Since I am working on an old rails project to work, I had to install ree-1.8.7-2012.02

 rvm install ree-1.8.7-2012.02 

Of course, Murphy's law still applies. I ran into another problem when my laptop could not find the Non-broken C compiler, although Xcode was installed with gcc. My last steps were posted to https://github.com/kennethreitz/osx-gcc-installer and installed their package and reinstall ree.

I hope this last solution helps someone. Good luck

0
Nov 21 '12 at 9:52
source share

For my setup, adding a user that apache works, how the rvm group works

 usermod -a -G rvm www-data 
0
Feb 28 '13 at 3:04 on
source share

I also had this problem. I fixed my problem by specifying gemset.

 $ bundle install ERROR: Gem bundler is not installed, run `gem install bundler` first. $ rvm gemdir /usr/local/rvm/gems/ruby-1.9.3-p194 $ rvm gemset list gemsets for ruby-1.9.3-p194 (found in /usr/local/rvm/gems/ruby-1.9.3-p194) global rails32 $ rvm gemset use rails32 Using ruby-1.9.3-p194 with gemset rails32 $ rails s Could not find rake-10.0.4 in any of the sources Run `bundle install` to install missing gems. $ bundle install Fetching gem metadata from https://rubygems.org/....... {And voila! it worked!} 
0
Jun 27 '13 at 15:27
source share



All Articles