Created
April 26, 2012 23:37
-
-
Save joshnabbott/2504192 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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