If the problem is located in a third-party gem instead of your own code, then it might be easier to use Andi Idogawa's file_exists gem, at least temporarily (explanatory blog post).
bundle add file_exist
Then add to e.g. config/boot.rb:
require 'file_exists'