This is a tricky problem without an easy, always-right answer. Some places to start include:
- Sweep unused code into the dustbin with rcov
- Performance Testing Ruby on Rails Applications
- Find unused code in a Rails app
The biggest issue is that unused code and unreachable code aren't the same things. Just because code isn't exercised routinely in production doesn't really mean it's dead code that should be removed. It may be there for a reason---just not one that comes up often.