Aamir
Aamir

Reputation: 16957

require 'bundler' error, cannot load such file -- bundler (LoadError)

Unable to run rails console, rails -v etc. Already tried all of the solutions, reinstalled ruby, installed bundler but neither worked for me.

Traceback (most recent call last):
    4: from bin/rails:3:in `<main>'
    3: from bin/rails:3:in `load'
    2: from /var/www/App/releases/XXXXXXXXXXX/bin/spring:8:in `<top (required)>'
    1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler (LoadError)

Upvotes: 1

Views: 1467

Answers (1)

Aditya Tiwari
Aditya Tiwari

Reputation: 209

A few days back I also land up into the same issue, I think it was due to spring caching some gems and configurations. I fixed it by running bundle pristine.

This restores installed gems based on the Gemfile.lock to pristine condition from files located in the gem cache.

Upvotes: 1

Related Questions