Trouble setting up Vagrant

2019-04-13 16:14发布

问题:

I've been trying to setup Vagrant to learn Django for a while now. I am following [http://gettingstartedwithdjango.com/en/lessons/introduction-and-launch/][1] tutorial. The first error is default: stdin is not a tty and the second is

==> default: ERROR:  Error installing chef:
==> default:    mixlib-shellout requires Ruby version >= 1.9.3.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

I am using Ubuntu 14.04 LTS x86_64 as host machine.

sudo apt-get install ruby gives me "Already in the newest version". Tried installing chef manually. No luck either :(

回答1:

I had a very similar issue (Vagrant, Django) which I solved by downgrading Chef. I had to pin a couple of gems too due to some version mismatches. This didn't solve all my issues but it did solve the OP's error with mixlib-shellout.

In my Vagrant file # Install an older version of chef config.vm.provision :shell, :inline => 'apt-get install build-essential ruby1.9.1-dev --no-upgrade --yes' config.vm.provision :shell, :inline => "gem install mixlib-shellout --version 1.4.0 --no-rdoc --no-ri --conservative" config.vm.provision :shell, :inline => "gem install ohai --version 7.4 --no-rdoc --no-ri --conservative" config.vm.provision :shell, :inline => "gem install chef --version 11.18.12 --no-rdoc --no-ri --conservative"

More here. https://www.chef.io/blog/2014/12/02/postmortem-ohai-mixlib-shellout-gem-release-issues/