Skip to content
Just a little demonstration - when using one Ruby script from within another, you need Bundler.with_original_env
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


See this post for the full explanation:

But in short: This is a test setup for what happens when you call one "inner" Ruby script from an "outer" directory, both with a Gemfile in it. The inner one will keep the gems set up in the outer one, and therefore will be missing its gems mysteriously. Using Bundler.with_original_env fixes this.

bundler_env_error_test $ ./wrangler 

Let's get wranglin'.
| Moo moo I'm a cow yo. |
      \   ^__^
       \  (oo)\_______
          (__)\       )\/\
              ||----w |
              ||     ||
Traceback (most recent call last):
	1: from ./cow:5:in `<main>'
./cow:5:in `require': cannot load such file -- cowsay (LoadError)
You can’t perform that action at this time.