
Vagrantfile problem
By: a guest on
May 11th, 2012 | syntax:
Ruby | size: 1.03 KB | hits: 29 | expires: Never
# I have a Vagrantfile (Ruby) beginning:
require 'rubygems'
require 'git'
# But "vagrant reload" (say) fails with LoadError -- git ...
# But the git gem is installed:
$ /opt/vagrant/embedded/bin/irb
irb(main):001:0> require 'git'
=> true
irb(main):002:0> $LOAD_PATH
=> ["/opt/vagrant/embedded/lib/ruby/gems/1.9.1/gems/git-1.2.5/lib", "/opt/vagrant/embedded/lib/ruby/site_ruby/1.9.1", "/opt/vagrant/embedded/lib/ruby/site_ruby/1.9.1/i686-linux", "/opt/vagrant/embedded/lib/ruby/site_ruby", "/opt/vagrant/embedded/lib/ruby/vendor_ruby/1.9.1", "/opt/vagrant/embedded/lib/ruby/vendor_ruby/1.9.1/i686-linux", "/opt/vagrant/embedded/lib/ruby/vendor_ruby", "/opt/vagrant/embedded/lib/ruby/1.9.1", "/opt/vagrant/embedded/lib/ruby/1.9.1/i686-linux"]
irb(main):003:0>
# I have to do this at the top of the Vagrantfile:
$LOAD_PATH.push('/opt/vagrant/embedded/lib/ruby/gems/1.9.1/gems/git-1.2.5/lib/')
require 'rubygems'
require 'git'
# Is there any way to avoid the "$LOAD_PATH.push" step, so that vagrant works transparently?