Vgrant: ohai requires Ruby version >= 2.0.0

I tried to run discourse in a VM via the Vagrantfile: https://github.com/discourse/discourse/blob/master/Vagrantfile

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?

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 - http://git.io/vvkI4 | 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 - http://git.io/vvkI4 | bash && gem install chef --no-rdoc --no-ri --conservative"
3 Likes

I created a Pull request at Github: https://github.com/discourse/discourse/pull/3363