Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save toolmantim/194648 to your computer and use it in GitHub Desktop.

Select an option

Save toolmantim/194648 to your computer and use it in GitHub Desktop.
# To be stuck in the top of your Sinatra app or whichever file you want to
# declare the gems.
#
# Use this to ensure you use the same local gems as you do in production.
# Check it's a file as Heroku replaces .gems with a dir full of gems
File.file?(gems_file = "#{File.dirname(__FILE__)}/.gems") && File.read(gems_file).each do |gem_decl|
gem_name, version = gem_decl[/^([^\s]+)/,1], gem_decl[/--version ([^\s]+)/,1]
version ? gem(gem_name, version) : gem(gem_name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment