Vgrant: ohai requires Ruby version >= 2.0.0


#1

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


#3

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"

#4

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