Skip to content

Instantly share code, notes, and snippets.

@ik5
Forked from anonymous/exec.rb
Last active December 17, 2015 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik5/5543040 to your computer and use it in GitHub Desktop.
Save ik5/5543040 to your computer and use it in GitHub Desktop.
Allow to execute commands using Ruby that arrives from gem and using Bundler Gemfile
$BASE_PATH = File.expand_path(File.dirname(__FILE__) + '/..')
# also find your own gem files for the executable
$LOAD_PATH.unshift($BASE_PATH + '/lib')
require 'bundler'
ENV["BUNDLE_GEMFILE"] = $BASE_PATH + '/Gemfile'
Bundler.require(:default)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment