Closed neovatar closed 9 years ago
Thomas,
Thanks for the detailed report! I'll investigate on the issue as soon as I can.
Thanks for the quick response Emiliano! I did some further debugging with vagrant and added some stuff in mitchellh/vagrant#6242.
Fixed! :sunglasses:
I just noticed, that starting with Vagrant 1.7.3 the execution of ruby commands via the vagrant-triggers plugin (and possibly all exeution of external ruby commands) is broken.
When calling a command via vagrant-triggers
run
, vagrant-triggers takes care to deleteGEM_HOME
,GEM_PATH
andGEMRC
from the environment (in https://github.com/emyl/vagrant-triggers/blob/master/lib/vagrant-triggers/dsl.rb#L87), so we can execute ruby commands, that depend on a non vagrant ruby environment.But vagrant introduced a new "magic" to check if it is executed via bundler, and restores the vagrant environment for the subprocess. So if you call a ruby process, vagrant enforces the old environment and
GEM_HOME
,GEM_PATH
andGEMRC
point to the vagrant specific gem locations and things break because gems are not found.We can set
VAGRANT_SKIP_SUBPROCESS_JAILBREAK
environment variable to disable the magic, but we need to set it before calling vagrant. Setting it in the Vagrantfile does not seem to work.https://docs.vagrantup.com/v2/other/environmental-variables.html
I am not sure, how to work around this or how to switch off this behaviour from within the Vagrantfile. It was introduced in Vagrant 1.7.3 (a minor release) and breaks stuff that worked with 1.7.2.
This is not a vagrant-triggers bug, I opened a vagrant bug: https://github.com/mitchellh/vagrant/issues/6242
But maybe @emyl can think of a workaround to make vagrant-triggers with ruby commands work again.