Skip to content

Instantly share code, notes, and snippets.

@MSch
Created January 28, 2012 16:25
Show Gist options
  • Save MSch/1694921 to your computer and use it in GitHub Desktop.
Save MSch/1694921 to your computer and use it in GitHub Desktop.
# Add all gems in the global gemset to the $LOAD_PATH so they can be used even
# if they're not in the Gemfile. e.g. pry
if defined?(::Bundler)
global_gemset = ENV['GEM_PATH'].split(':').grep(/ruby.*@global/).first
if global_gemset
all_global_gem_paths = Dir.glob("#{global_gemset}/gems/*")
all_global_gem_paths.each do |p|
gem_path = "#{p}/lib"
$LOAD_PATH << gem_path
end
end
end
begin
require 'pry'
require 'pry-nav' rescue LoadError nil
# Don't require for now due to https://github.com/nixme/pry-nav/issues/4
# require 'pry-stack_explorer' rescue LoadError nil
Pry.start
rescue LoadError
require 'irb'
IRB.start(__FILE__)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment