From 05fdb3e0002fca795a97fffb8ce06c64351d1cd4 Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Thu, 19 Mar 2015 16:21:57 -0700 Subject: [PATCH] vagrant-lxc-wrapper: Use correct ruby interpreter Previously, we hardcoded to using the ruby binary in /opt/vagrant[..]. On some systems, this path is incorrect, so instead we use the path of the interpreter that is executing the `vagrant lxc sudoers` command. --- lib/vagrant-lxc/command/sudoers.rb | 1 + templates/sudoers.rb.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-lxc/command/sudoers.rb b/lib/vagrant-lxc/command/sudoers.rb index fcb2099..42b538a 100644 --- a/lib/vagrant-lxc/command/sudoers.rb +++ b/lib/vagrant-lxc/command/sudoers.rb @@ -83,6 +83,7 @@ module Vagrant hash[cmd] = `which #{cmd}`.strip end hash['lxc_bin'] = Pathname(`which lxc-create`.strip).parent.to_s + hash['ruby'] = Gem.ruby end end end diff --git a/templates/sudoers.rb.erb b/templates/sudoers.rb.erb index 94db7f7..e9e6fd5 100644 --- a/templates/sudoers.rb.erb +++ b/templates/sudoers.rb.erb @@ -1,4 +1,4 @@ -#!/opt/vagrant/embedded/bin/ruby +#!<%= cmd_paths['ruby'] %> # Automatically created by vagrant-lxc class Whitelist