Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find RubyGem bundler

I've cloned diaspora for github, git://github.com/diaspora/diaspora.git

I tried to install it. An error generated when I use bundle install.

$ bundle install 
/usr/local/lib/site_ruby/1.8/rubygems.rb:812:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
    from /usr/local/lib/site_ruby/1.8/rubygems.rb:223:in `activate'
    from /usr/local/lib/site_ruby/1.8/rubygems.rb:1146:in `gem'
    from /usr/bin/bundle:18

I'm using rails 3 and ruby 1.8 on ubuntu 11.04. How to fix it? Please help

like image 882
Sayuj Avatar asked Jun 24 '11 10:06

Sayuj


People also ask

How do you install a bundler?

Install BundlerSelect Tools | Bundler | Install Bundler from the main menu. Press Ctrl twice and execute the gem install bundler command in the invoked popup. Open the RubyMine terminal emulator and execute the gem install bundler command.

How do I change my default bundler?

gem env – try to search in provided list under GEM PATHS, in specifications/default. remove there bundler-VERSION. gemspec. install bundler, if you don't have specific: gem install bundler:VERSION --default.

How do I update my bundler?

Upgrading applications from Bundler 1 to Bundler 2 Bundler will never change your application to a new major version until you choose to do so. If your application is ready, you can upgrade that application to the latest installed version of Bundler by running bundle update --bundler .


3 Answers

Did you install bundler gem?

$ gem install bundler

You might need sudo privileges.

like image 182
Simone Carletti Avatar answered Oct 21 '22 23:10

Simone Carletti


Hmm, maybe you've got the bundle command and bundler gem installed for /usr/bin/ruby, and after that installed another Ruby in /usr/local/bin/ruby?

Could you do a which ruby and head -1 /usr/bin/bundle? Maybe also a gem list?

like image 43
Marten Veldthuis Avatar answered Oct 21 '22 22:10

Marten Veldthuis


Presumably this has been fixed long ago, but for the benefit of others....

My issues was that while I had installed the bundler gem it had been installed in a different location to the current GEM_PATH - so it couldn't be found.

So,

GEM_PATH=/usr/lib/ruby/gems/1.8/ bundle install

did the business, setting the value of GEM_PATH to the actual location of the gems folder where the bundler gem has been installed.

like image 2
ChrisW Avatar answered Oct 21 '22 23:10

ChrisW