The problem with this approach is that if OS X updates Gemfile.lock, the pearl will be turned on. This becomes problematic if another developer updates any gem in the gemfile since the bundler will not include the gem when it calculates the dependencies.
My approach to solving this type of problem was to manually install the gem that I want, and then require both:
begin require 'os-x-gem' rescue LoadError end begin require 'linux-gem' rescue LoadError end
source share