Vgrant: ohai requires Ruby version >= 2.0.0


I tried to run discourse in a VM via the Vagrantfile: discourse/Vagrantfile at master · discourse/discourse · GitHub

After enabling Virtualization in my BIOS settings of my computer, the installation started to work fine until this error:

==> default: ERROR:  Error installing chef:
==> default:     ohai requires Ruby version >= 2.0.0.

There is this line:

config.vm.provision :shell, :inline => "apt-get -qq update && apt-get -qq -y install ruby1.9.3 build-essential && gem install chef --no-rdoc --no-ri --conservat

which seems to use ruby1.9.3, is there something wrong with the Vagrantfile?

(Sam Saffron) #2

Thats a bug in the vagrant setup it needs to updated asap to ruby 2.2.1


since the vagrant script still uses Ubuntu 12.04 ruby 2.0 is not implemented.

I created a short solution here at Stackoverflow that uses a Gist.

wget -O - | bash

So this provision line fixes the problem (and adds some extra output with set -x):

 config.vm.provision :shell, :inline => "set -x; apt-get update && apt-get -y install build-essential && wget -O - | bash && gem install chef --no-rdoc --no-ri --conservative"


I created a Pull request at Github: Update Vagrantfile to install ruby 2.0 by rubo77 · Pull Request #3363 · discourse/discourse · GitHub