Resolving Debugger Gem Installation Failures
Last updated September 17, 2024
This article is a work in progress, or documents a feature that is not yet released to all users. This article is unlisted. Only those with the link can access it.
There are several gems that require specific patch levels of the Ruby they’re running on. This practice is detrimental to a production app as it locks you into a specific patch level of Ruby. It prevents you from upgrading to receive security fixes.
Heroku releases security patches for Ruby versions as they become available from Ruby core. After we upgrade a Ruby version, your app gets the new version on the next deploy. If your app was using one of these gems, you see a failure when installing gems if we upgraded the version of Ruby you’re using. A failure can look like this:
Installing debugger-linecache
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
Or like this:
Installing debugger
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
The best way to avoid this problem is to not use debugger
or any other debugging gems in production. These gems are designed to hook into the low-level components of a language for dynamically stopping and inspecting execution of running code. Don’t install debugger
in production. Instead, move these gems to your development
group of the Gemfile
:
group :development do
gem "debugger"
end
Then bundle install
, commit to Git, and redeploy.