Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundler/setup (LoadError)

I cloned a repository and tried to run rails s. However, I received the following error:

/Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler/setup (LoadError) from /Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/me/workspace/bindo/config/boot.rb:7:in `<top (required)>' from /Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from bin/rails:9:in `<main>' 

My ruby version is:

ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-darwin13.3.0] 

My gem env command run from this project directory:

RubyGems Environment:   - RUBYGEMS VERSION: 1.8.23.2   - RUBY VERSION: 1.9.3 (2014-05-14 patchlevel 547) [x86_64-darwin13.3.0]   - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/2.0.0   - RUBY EXECUTABLE: /Users/me/.rbenv/versions/1.9.3-p547/bin/ruby   - EXECUTABLE DIRECTORY: /usr/lib/ruby/gems/2.0.0/bin   - RUBYGEMS PLATFORMS:     - ruby     - x86_64-darwin-13   - GEM PATHS:      - /usr/lib/ruby/gems/2.0.0      - /Users/me/.gem/ruby/1.9.1      - /Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1   - GEM CONFIGURATION:      - :update_sources => true      - :verbose => true      - :benchmark => false      - :backtrace => false      - :bulk_threshold => 1000   - REMOTE SOURCES:      - http://rubygems.org/ 

I read on Stack Overflow that this is a path error, however, I am not familiar enough to figure out what to trace or change to make this work. I'm looking but I feel I need some direction.

like image 525
Marco Lau Avatar asked Oct 25 '14 08:10

Marco Lau


People also ask

How does bundler work in Rails?

Think of bundler as a package management tool. So bundle install command will install all gems to the system that are listed in Gemfile as well as their dependencies. If the gem was not previously installed it will grab it from the gemcutter repo.

What is bundler in gem?

What is Bundler? Bundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that are needed. Bundler is an exit from dependency hell, and ensures that the gems you need are present in development, staging, and production.

Is bundler included with Ruby?

As of Ruby 2.6. 0preview3, Bundler is part of core Ruby.


1 Answers

You likely have bundler gem missing.

To get it to work run (first command may need be executed with sudo, depending on your environment):

[sudo] gem install bundler bundle install 
like image 126
Aleksei Matiushkin Avatar answered Oct 09 '22 04:10

Aleksei Matiushkin