Skip to content

Instantly share code, notes, and snippets.

@joshnabbott
Created April 26, 2012 23:37
Show Gist options
  • Select an option

  • Save joshnabbott/2504192 to your computer and use it in GitHub Desktop.

Select an option

Save joshnabbott/2504192 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
# in places like 'rails console'.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment