Created
November 13, 2009 14:04
-
-
Save DAddYE/233848 to your computer and use it in GitHub Desktop.
This file contains 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
# Attempts to require all dependencies with bundler | |
begin | |
require 'bundler' | |
Bundler::Environment.load(root_path + "/Gemfile").require_env(RACK_ENV) | |
rescue Bundler::DefaultManifestNotFound => e | |
puts "You didn't create Bundler Gemfile manifest or you are not in a Sinatra application." | |
end | |
# Attempts to load budled gems if it fail we try to use system wide gems | |
begin | |
require root_path('/../vendor', 'gems', RACK_ENV) | |
puts "We use bundled gems" | |
rescue LoadError => e | |
puts "We use system wide gems" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment