When attempting to run bundle install or bundle update, bundler will perpetually hang, and not complete its function. The only time that it will finish is when I specify a gem to update.
For example:
bundle update
Will hang forever unless I use it like this:
bundle update activerecord
Then it will complete as normal.
Any assistance would be appreciated.
This problem is due to a missing dependency, or worse a dependency-of-a-dependency. It’s common when you don’t use rubygems.org as your gemserver (an enterprise environment).
Common patterns:
Easiest Technique
create a new gemset, and re-bundle. This fixes the problem many times.
If you can’t do that for production reasons, and you don’t have an app history from which to reflect on when the problem gem was added, then:
Easier Technique
Having learned a bit since writing this answer, I thought I’d pass on this excellent article for how to run bundler with verbose debug output
This will dump all the debugging (err) output to
debug_output.txtand the normal screen stuff tostdio.txt.You’ll want to dump
1>as well because every time bundler dumps a line to2(stderr) it will put a crlf into1. So Either dump1or background the job. I do both so I can work in the same terminal.I usually follow it up with:
to be sure things have started, then:
To search with
/FAIL]through the file for failed attempts to install a dependency. Find a couple of them that are the same and you’ve generally located your culprit. Thestderrworks forbundle installorbundle update.Debug Your Private Gemserver Technique
I needed to use this process-of-elimination method to determine that my (enterprise) gemserver index had become corrupted
bundle updateto confirm the empty-set worksbundle updateWhen you are done
Unset the
ENVvar withSolution for permissions
Ensure that the credentials in your
GITHUB_TOKENmatches yourbundle config --global github.com <your token>