Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails - Bundle: command not found

Encountered a problem when I tried to run/check bundle on on Mac Bundler/bundler are in the local gem list when I did gem list --local

Gem env returns the following

 RubyGems Environment:       - RUBYGEMS VERSION: 2.0.14       - RUBY VERSION: 2.0.0 (2014-05-08 patchlevel 481) [universal.x86_64-darwin14]       - INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0       - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby       - EXECUTABLE DIRECTORY: /usr/bin       - RUBYGEMS PLATFORMS:         - ruby         - universal-darwin-14       - GEM PATHS:          - /Library/Ruby/Gems/2.0.0          - /Users/jenny0322/.gem/ruby/2.0.0          - /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0       - GEM CONFIGURATION:          - :update_sources => true          - :verbose => true          - :backtrace => false          - :bulk_threshold => 1000       - REMOTE SOURCES:          - https://rubygems.org/ 

Echo Path returns

/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin 

which gem returns

/usr/bin/gem 

How do I add path to the directory? I tried

export PATH ="/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin:$PATH" 

and have no luck...

like image 531
Jenny Chen Avatar asked Dec 25 '15 03:12

Jenny Chen


People also ask

Why is the bundle command not working?

When you get the rbenv: bundle: command not found error it is most likely the case that you have installed a new Ruby version and you are trying to run a bundle command inside an existing project directory. For every new Ruby version you install, you also need to install the Bundler gem.

What does bundle command do?

The bundle exec command ensures that executable programs installed by Gems don't interfere with your app's requirements. For instance, if your app needs a specific version of rake but the default version of rake differs, bundle exec ensures that you can still run the specific rake version compatible with your app.

What is bundle install in rails?

Bundler makes sure that Ruby applications always use the exact gems and versions that you need while keeping a consistent environment and gem dependencies satisfied. This is done by ensuring that the gems you need are present in the development, staging, and production stages.


2 Answers

It seems that Bundler is not installed in your machine.

You have to install bundler first for that.

1: gem install bundler

2: bundle install

Hope this help you !!!

like image 140
Gupta Avatar answered Sep 22 '22 09:09

Gupta


Open a new terminal window and run:

gem install bundler

Then, try again.

See the documentation.

like image 23
K M Rakibul Islam Avatar answered Sep 20 '22 09:09

K M Rakibul Islam