Bundle install freezes when adding GitHub gem dependency to Rails project

I’m working on a Rails application and need to use an updated version of a gem that I found on GitHub. The official version seems outdated so I want to use this newer fork instead.

I added this line to my Gemfile:

gem 'pdf-converter-binary', github: 'MyCompany/pdf_converter_gem'

When I try to run bundle install, the process gets stuck during the fetching phase and never completes. It just sits there without any error messages or progress updates.

Has anyone experienced this issue before? What could be causing bundler to hang when trying to install a gem directly from a GitHub repository? I’ve tried waiting for several minutes but nothing happens. Any suggestions on how to fix this problem would be really helpful.

This hanging usually means bundler’s stuck resolving conflicting dependencies. I hit the same issue when the GitHub gem clashed with my existing gems. Try bundle update instead of bundle install - it’s more aggressive about resolving version conflicts. What also helped was temporarily yanking other gems from my Gemfile to see if this specific gem was the culprit or causing a cascade of dependency problems. GitHub repos sometimes don’t tag releases properly, so bundler can’t figure out which commit to use.

Bundle freezes when GitHub rate limits you, especially on corporate networks or after frequent requests. Try bundle config set timeout 300 to give it more time.

Another fix that worked for me: check if the repo’s gemspec is set up right. Some GitHub repos have broken gemspecs that bundler can’t process. Clone the repo manually and run gem build on the gemspec. If it fails, the gem’s misconfigured and bundler will hang forever trying to resolve it.

Check your Git config - it might be causing the freeze. I hit this when my global Git settings had credential helper timeouts set way too high. Run git config --global credential.helper to see what’s set up. Sometimes bundler just sits there waiting for credentials that never show up. Try specifying the exact branch or tag in your Gemfile like gem 'pdf-converter-binary', github: 'MyCompany/pdf_converter_gem', branch: 'main' instead of letting bundler guess. Also worked for me: bundle config set git.allow_insecure true temporarily if the repo has SSL cert issues, but don’t do this in production.

kill the bundler process and clear your gem cache first. bundler gets stuck on corrupted github cache data sometimes. run rm -rf ~/.bundle then try again - this worked for me when everything else failed. also check that the github repo branch actually exists. bundler will hang without any error if it can’t find the default branch.

Had this exact problem last month with a private repo gem. It’s usually authentication or network issues with GitHub’s servers. Run bundle install --verbose to see where it actually hangs. If it’s dying during git clone, check your SSH keys or switch to HTTPS format. Bundler loves caching failed attempts, so try bundle clean --force first. Also double-check the repo exists and you can actually reach it from your network.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.