Skip to content

Instantly share code, notes, and snippets.

@rf-
Created February 21, 2012 04:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rf-/1873759 to your computer and use it in GitHub Desktop.
Save rf-/1873759 to your computer and use it in GitHub Desktop.
require 'pry'
require 'pry-exception_explorer'
require 'pry-exception_explorer/shim_builder'
binary_name = "lib_overrides.#{PryExceptionExplorer::ShimBuilder::Dyname}"
if !File.exists? File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
puts "First run, building shim"
PryExceptionExplorer::ShimBuilder.compile
puts "Hopefully built...!"
end
if RUBY_PLATFORM =~ /darwin/
ENV['DYLD_FORCE_FLAT_NAMESPACE'] = "1"
ENV['DYLD_INSERT_LIBRARIES'] = File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
else
ENV['LD_PRELOAD'] = File.join PryExceptionExplorer::ShimBuilder.dir, binary_name
end
exec 'rails server' # or whatever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment