From f8241645fcee4422f86a8761c8ddee0c2bdc4038 Mon Sep 17 00:00:00 2001 From: Gerben Meijer Date: Mon, 11 Apr 2016 16:02:42 +0200 Subject: [PATCH] Must load vagrant before checking version --- lib/vagrant-libvirt.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/vagrant-libvirt.rb b/lib/vagrant-libvirt.rb index 0eb3619..e1929e9 100644 --- a/lib/vagrant-libvirt.rb +++ b/lib/vagrant-libvirt.rb @@ -13,6 +13,12 @@ module VagrantPlugins end end +begin + require 'vagrant' +rescue LoadError + raise 'The Vagrant Libvirt plugin must be run within Vagrant.' +end + # This is a sanity check to make sure no one is attempting to install # this into an early Vagrant version. if Vagrant::VERSION < '1.5.0'