webdevops/vagrant-docker-vm

OS is not a module

kraeml opened this issue · 9 comments

If I run vagrant up, I got this error

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/michl/Dokumente/Schule/Bento-Boxen/devvm/Vagrantfile
Line number: 70
Message: TypeError: OS is not a module

My vagrant version is 2.0.1 and ruby version is ruby 2.3.1p112

I have no idea how to get up this Vagrantfile.

Any successions would be nice.

can you try to install the OS gem?
gem install os

Here my bash output:

sudo gem install os
Successfully installed os-1.0.0
Parsing documentation for os-1.0.0
Done installing documentation for os after 0 seconds
1 gem installed
michl@michl-laptop:~/Dokumente/Schule/Bento-Boxen/devvm$ vagrant up
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/michl/Dokumente/Schule/Bento-Boxen/devvm/Vagrantfile
Line number: 70
Message: TypeError: OS is not a module

Same error.

UPDATE:

My working system is Ubuntu 16.04.

Can you add require 'os' to the header of Vagrantfile? does that fix your issue?

I added the line but the same error.

I added it in line 3 and 5 and after require yaml. Always same error.

May vagrant install ruby in a "PRIVATE" dictonary?

Hm.. i think so
Strage, this module was always part of vagrant :(

BTW: on linux you can use dory(https://github.com/FreedomBen/dory) to get the same setup but without a VM and with real native speed (running docker native on linux with automatic reverse proxy)

Thanks for your info. I use Linux as a teacher but my students use Win or Mac and somtimes Linux. Hope we will find a solution.

I have tested hashicorp/vagrant#9177 but it dosen't work here:

vagrant plugin install os                             
Installing the 'os' plugin. This can take a few minutes...
Installed the plugin 'os (0.9.6)'!
ls ~/.vagrant.d/gems/gems 
builder-3.2.3             ffi-1.9.17          micromachine-2.0.0  os-0.9.6     rspec-core-3.5.4          rspec-support-3.5.0  serverspec-2.38.0  specinfra-2.66.4            vagrant-serverspec-1.1.1
concurrent-ruby-1.0.2     httpclient-2.8.2.4  minitest-5.9.1      rack-2.0.1   rspec-expectations-3.5.0  rubyntlm-0.6.1       sfl-2.3            thread_safe-0.3.5           vagrant-share-1.1.6
diff-lcs-1.2.5            httpclient-2.8.3    net-telnet-0.1.1    rake-11.3.0  rspec-its-1.2.0           serverspec-2.37.1    specinfra-2.63.3   vagrant-hostsupdater-1.0.2  vagrant-vbguest-0.13.0
domain_name-0.5.20161129  http-cookie-1.0.3   nio4r-1.2.1         rspec-3.5.0  rspec-mocks-3.5.0         serverspec-2.37.2    specinfra-2.64.0   vagrant-reload-0.0.1        websocket-extensions-0.1.2

vagrant up                        
There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /home/michl/Dokumente/Schule/Bento-Boxen/devvm/Vagrantfile
Line number: 71
Message: TypeError: OS is not a module

I included the require 'os' still the same.

@kraeml Please check if this is fixed now

vagrant up is running. thanks