# Vgrant: ohai requires Ruby version \>= 2.0.0

**URL:** <https://meta.discourse.org/t/vgrant-ohai-requires-ruby-version-2-0-0/27465>\
**Category:** Self-hosting\
**Created:** [Avril 11, 2015, 11:31 UTC](https://meta.discourse.org/t/vgrant-ohai-requires-ruby-version-2-0-0/27465 "2015-04-11T23:31:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubo77](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rubo77/32/41019_2.png) [@rubo77](https://meta.discourse.org/u/rubo77)\
**Post date:** [Avril 11, 2015, 11:31 UTC](https://meta.discourse.org/t/vgrant-ohai-requires-ruby-version-2-0-0/27465/1 "2015-04-11T23:31:20Z")

</div>

I tried to run discourse in a VM via the Vagrantfile: [https://github.com/discourse/discourse/blob/master/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?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [Avril 11, 2015, 11:49 UTC](https://meta.discourse.org/t/vgrant-ohai-requires-ruby-version-2-0-0/27465/2 "2015-04-11T23:49:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rubo77](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rubo77/32/41019_2.png) [@rubo77](https://meta.discourse.org/u/rubo77)\
**Post date:** [Avril 12, 2015, 12:03 UTC](https://meta.discourse.org/t/vgrant-ohai-requires-ruby-version-2-0-0/27465/3 "2015-04-12T00:03:04Z")

</div>

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

I created a short solution here at [Stackoverflow](http://stackoverflow.com/a/29584352/1069083) that uses a [Gist](https://gist.github.com/rubo77/ba9b64b160fe46e44aa1).

```
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"

```

---

<div class="post-metadata">

**Author:** ![rubo77](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rubo77/32/41019_2.png) [@rubo77](https://meta.discourse.org/u/rubo77)\
**Post date:** [Avril 12, 2015, 12:16 UTC](https://meta.discourse.org/t/vgrant-ohai-requires-ruby-version-2-0-0/27465/4 "2015-04-12T00:16:27Z")

</div>

I created a Pull request at Github: [Update Vagrantfile to install ruby 2.0 by rubo77 · Pull Request #3363 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/3363)
