When a Ruby program doesn't crash but hangs indefinitely or becomes very slow, it can be difficult to debug. Add a sampling profiler to see where the program hangs or slows down.
A binstub with a bad “shebang” line can cause your application to function improperly. This article explains binstubs, shebang lines, and the common errors that come from improperly generated binstubs.
H12 errors are especially difficult. They can be equally caused by a lack of throughput capacity (need to add more dynos), an extremely long-running request or requests that back up others, or some shared resource like a database receiving higher
Sometimes a Ruby app generates a segfault - usually caused by an extension. This article illustrates the typical causes, and how to find the faulty gem.
Ruby applications should gracefully shut down when a dyno shuts down, or is restarted. Sensitive operations should be wrapped in an `ensure` clause, though care must be taken to have this clause terminate.