On Friday, May 25, 2012 7:13:08 PM UTC-5, lukewpatterson wrote:
Considering the Vagrantfile approach first - In the beginning portion of the Vagrantfile, how can I programmatically install gems that later portions of the file will 'require'? Does anyone have any examples of this? I've tried a few hacks but it seems like things might be complicated by the private Ruby configuration that Vagrant uses.
for installing librarian gem in the Vagrantfile, for later use in the Vagrantfile, got this hack to work:
librarian_name = 'librarian'
librarian_version = '0.0.23'
begin
Gem::Specification.find_by_name(librarian_name, librarian_version)
rescue Gem::LoadError
begin
require 'vagrant/environment'
env = Vagrant::Environment.new
env.cli('gem', 'install', librarian_name, '--version', librarian_version)
rescue SystemExit
end
end
not sure how advisable it is, I guess I'll find out