Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX bundler install command not found

I'm getting this error:

Could not find i18n-0.6.1 in any of the sources Run bundle install to install missing gems.

When i try to run bundle install, i get this:

-bash: bundle: command not found

I have googled and tried to solve this for a while now with no hope. Please help.

like image 914
Al1nuX Avatar asked Jun 05 '13 21:06

Al1nuX


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.


2 Answers

Don't mess with your PATH.

Just use rbenv and ruby-build to manage and install your ruby version(s).

And then install the bundler gem and rehash.

Install rbenv (if you haven't already) as follows:

$ brew update
$ brew install rbenv ruby-build

Initialize rbenv as follows:

$ rbenv init   

Install ruby-build to compile and install different versions of Ruby on UNIX-like systems:

brew install ruby-build

Install a specific ruby version, e.g., 1.9.3-p551:

$ RUBY_VERSION=1.9.3-p551
$ ruby-build $RUBY_VERSION $HOME/.rbenv/versions/$RUBY_VERSION

Verify it worked:

$ ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin14.0.0]

Set that version to be the global/default Ruby version:

$ rbenv global 1.9.3-p551

Install bundler:

$ gem install bundler
Fetching: bundler-1.7.11.gem (100%)
Successfully installed bundler-1.7.11
1 gem installed

Update rbenv:

$ rbenv rehash

Now, bundler will be available in the version of Ruby (1.9.3-p551) that you just installed.

Verify RubyGems Environment:

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.23.2
  - RUBY VERSION: 1.9.3 (2014-11-13 patchlevel 551) [x86_64-darwin14.0.0]
  - INSTALLATION DIRECTORY: /Users/lex/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /Users/lex/.rbenv/versions/1.9.3-p551/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/lex/.rbenv/versions/1.9.3-p551/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-14
  - GEM PATHS:
     - /Users/lex/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1
     - /Users/lex/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-document"
     - "install" => "--no-ri --no-rdoc"
     - "update" => "--no-ri --no-rdoc"
     - :sources => ["http://rubygems.org", "http://gems.github.com", "http://gems.rubyforge.org", "http://gemcutter.org"]
  - REMOTE SOURCES:
     - http://rubygems.org
     - http://gems.github.com
     - http://gems.rubyforge.org
     - http://gemcutter.org
like image 151
l3x Avatar answered Sep 28 '22 21:09

l3x


try to run

gem env

and then you will get something like this:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.23
  - RUBY VERSION: 1.9.3 (2013-06-27 patchlevel 448) [x86_64-darwin12.5.0]
  - INSTALLATION DIRECTORY: /usr/local/Cellar/ruby193/1.9.3-p448/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/Cellar/ruby193/1.9.3-p448/bin/ruby
  **- EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby193/1.9.3-p448/bin**
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-12
  - GEM PATHS:
     - /usr/local/Cellar/ruby193/1.9.3-p448/lib/ruby/gems/1.9.1
     - /Users/madhava/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Just add the executable directory to your PATH variable like this:

echo PATH=/usr/local/Cellar/ruby193/1.9.3-p448/bin:$PATH >> ~/.bash_profile

Reload your terminal to apply the changes and you will be set!

like image 27
Madhava Carrillo Avatar answered Sep 28 '22 20:09

Madhava Carrillo