Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Installed Vagrant via sudo apt-get install vagrant, and every time I try to run some vagrant command, such as vagrant init precise32 I get the following error:

/home/novito/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- log4r (LoadError)
    from /home/novito/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    from /usr/bin/vagrant:2:in `<main>'

Not sure why rvm gets involved here, but oh well, I hope you guys can guide me on how to solve this.

share|improve this question

When you installed Vagrant using apt-get it would have installed all its required dependencies for the standard Ubuntu-packaged version of Ruby. But your error message indicates that when you run vagrant it is trying to use a version of Ruby (and its Gems) that is managed by RVM rather than the system version, and your version of Ruby is missing at least one of its dependencies, log4r.

I think you have a few options:

  1. Revert to using the system (standard Ubuntu) version of Ruby by running something like rvm use system --default to reset RVM by default, and only change Ruby versions when you need to.
  2. Switch back to the system version just when running Vagrant, so run rvm use system before running vagrant in the same shell.
  3. Identify all the Ruby Gems that Vagrant depends on and manually install them in your RVM-managed Ruby installation. This would be a fiddly approach, though. It used to be possible to install Vagrant itself as a Ruby Gem, so you could have installed it in your RVM-managed Ruby installation, but that is not supported any more.

See the RVM command options documentation for more detail on controlling which version of Ruby you are using.

share|improve this answer
I still get this error, even when using the default Ubuntu ruby version. – Cerin Sep 18 '14 at 18:38

After I downloaded and installed Vagrant from the download page the error goes away.

share|improve this answer
Started following (…) these steps and got the error. The binary from vagrant site is working without an issue. To install run "dpkg -i name_of_package.deb" – kode Feb 25 '14 at 20:09

I had this issue as well. As it turns out, apparently you need ruby 1.9.3. I had installed Vagrant from source with 2.0.0 and the aforementioned error occurred until I reinstalled the gem with ruby 1.9.3.

share|improve this answer

I had a old custom ruby environment installed in my home (~/.rbenv) and this apparently overrides all the default system Ruby packages. When I deleted that folder, Vagrant started working just fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.