Skip to content

Instantly share code, notes, and snippets.

@brentd
Last active December 14, 2015 02:49
Show Gist options
  • Save brentd/5017017 to your computer and use it in GitHub Desktop.
Save brentd/5017017 to your computer and use it in GitHub Desktop.
Require outside of bundle
# Allows `require` to work for libs outside of Bundler's environment, so you can require
# gems that aren't in the project's Gemfile while inside an irb session (for example).
if defined?(Gem.post_reset_hooks)
Gem.post_reset_hooks.reject!{ |hook| hook.source_location.first =~ %r{/bundler/} }
Gem::Specification.reset
load 'rubygems/custom_require.rb'
alias gem require
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment