Skip to content
This repository has been archived by the owner on Mar 21, 2018. It is now read-only.

Run commands in clean bundler env #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tubbo
Copy link
Contributor

@tubbo tubbo commented Mar 26, 2013

Sometimes, Rain will fail to commit its changes to config/versions.yml and cause mass havoc in deployment. This was usually due to a rogue Git plugin that was using an outdated (system) version of Ruby and not included in the Gemfile (because it's not an application-level dependency). It has been fixed by wrapping all GitTools commands within a Bundler.with_clean_env block, which will ensure the proper Ruby and versions of each gem are loaded in as Rain is deploying.

Special thanks to @stevenharman who introduced me to this technique and @alindeman for expanding on it and providing a few extra options for running commands in a Bundler env. You guys rock!

Execute all Git commands in a `Bundler.clean_env` to ensure we're
using the right versions of everything. Fixes an issue where previously
a `rain` deploy could not be combined with any "Git hook"-creating
plugins, such as `git-tracker`, or else the commit would fail due to
the improper Ruby being used.

Thanks to @stevenharman and @alindeman for showing us this
awesome little Bundler trick, which helps us mitigate this issue and any
future problems that may be encountered in the course of Rain's use with
other Git plugins.
We're just wrapping the existing execution command in a
with_clean_env to mitigate this issue.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants