From 959bdada8277e468fcca4913b35b10d506d07368 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 1 Feb 2017 12:43:16 -0800 Subject: [PATCH] Fix environment gems_path location --- lib/vagrant/environment.rb | 2 +- test/unit/vagrant/environment_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 96c9adafd..8d2b5d8b8 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -121,7 +121,7 @@ module Vagrant @home_path = Util::Platform.fs_real_path(@home_path) @boxes_path = @home_path.join("boxes") @data_dir = @home_path.join("data") - @gems_path = @home_path.join("gems") + @gems_path = Vagrant::Bundler.instance.plugin_gem_path @tmp_path = @home_path.join("tmp") @machine_index_dir = @data_dir.join("machine-index") diff --git a/test/unit/vagrant/environment_test.rb b/test/unit/vagrant/environment_test.rb index 15d0a3e0e..4f16de765 100644 --- a/test/unit/vagrant/environment_test.rb +++ b/test/unit/vagrant/environment_test.rb @@ -67,6 +67,13 @@ describe Vagrant::Environment do end end + describe "#gems_path" do + it "is set to Vagrant::Bundler defined path" do + instance = described_class.new + expect(instance.gems_path).to eq(Vagrant::Bundler.instance.plugin_gem_path) + end + end + describe "#home_path" do it "is set to the home path given" do Dir.mktmpdir("vagrant-test-env-home-path-given") do |dir|