Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant can t require log4r

I m trying to follow chef quickstart tutorial, I m doing it on a Ubuntu 12.04 VM.

I ve created the git, cookbook... And I m at the point I m supposed to start vagrant for attaching the node. But even while freshly installed vagrant, I get this error:

~/chef-repo$ vagrant up --no-color
/opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require': cannot load such file -- log4r (LoadError)
    from /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
    from /usr/bin/vagrant:2:in '<main>'

I tried to apt-get remove vagrant, it show that a package log4r will become useless.

Even after reinstallation it give me the error.

I don t know what I made wrong, and have no idea on how to solve this.

EDIT: If I try with advanced setup, I get stuck at chef installation via gem:

~$ gem install chef
ERROR: Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
    uninitialized constant Gem::Command::InstallCommand
like image 419
DrakaSAN Avatar asked Feb 13 '23 18:02

DrakaSAN


1 Answers

Your Vagrant seems to use Chef's embedded ruby. I guess you installed Vagrant from Ubuntu's repository?

Download the official Debian/Ubuntu package from the downloads page, and install it from command line using:

sudo dpkg -i vagrant_*.deb

(Synaptic sometimes seems to try to pull down things from distro's repos when just double-clicking a .deb)

like image 136
tmatilai Avatar answered Feb 27 '23 22:02

tmatilai