mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 572 forks source link

nokogiri (LoadError) on Windows 7 with AWS provider #460

Open ghost opened 8 years ago

ghost commented 8 years ago

Vagrant version

1.8.1

Host operating system

Windows 7

Guest operating system

Amazon Linux 2015.09

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "dummy"

  config.vm.provider :aws do |aws, override|
    aws.keypair_name = "Peter Baumgarten"
    aws.ami = "ami-f36a7799"
    aws.aws_dir = ENV['HOME'] + "\\.aws\\"
    aws.aws_profile = "default"
    aws.availability_zone = "us-east-1"
    aws.instance_type = "t2.micro"
    aws.security_groups = "AMI BASE ACCESS"
    aws.subnet_id = "subnet-a7c8bb8c"
    aws.tags = {
               "Name" => "Peter Baumgarten",
               "Creation Method" => "Vagrant"
    }
    override.ssh.username = "ec2-user"
    override.ssh.private_key_path = "C:\\Users\\pbaumgar\\putty\\openssh_private"
  end
end

Please note, if you are using Homestead or a different Vagrantfile format, we may be unable to assist with your issue. Try to reproduce the issue using a vanilla Vagrantfile first.

Debug output

https://gist.github.com/peterbaumgarten/fe255dea2e1cd4d358f792595137fa1a

Expected behavior

a normal vagrant up using the aws provider as it work with the virtualbox provider

Actual behavior

A crash with an error message about nokogiri being unable to load https://gist.github.com/peterbaumgarten/3d21fd32ecbc1db5363b513118602da9

Steps to reproduce

  1. vagrant up using aws provider on windows 7 using latest vagrant

Let me know if there is other information I can add

mvn-rec commented 8 years ago

Same issue here.

rob1256 commented 8 years ago

There is an old issue for this but not sure if it was ever fixed: https://github.com/mitchellh/vagrant/issues/6766

I had the same issue and found a fix for it: http://stackoverflow.com/questions/35455391/vagrant-on-windows-error-cannot-load-such-file-nokogiri

Relevant fix below:

Change the nokogiri reference in: C:\HashiCorp\Vagrant\embedded\gems\specifications\vagrant-1.8.1.gemspec C:\HashiCorp\Vagrant\embedded\gems\specifications\vagrant.gemspec (if it exists) from: <nokogiri>, ["= 1.6.3.1"] to: <nokogiri>, [">= 1.6.3.1"] (note the >= as opposed to =)

Then run: vagrant plugin install nokogiri --plugin-version 1.6.7.1

ghost commented 8 years ago

I did what @rob1256 suggested now I get a different error listed below but this seems to be a separate issue

PS C:\Users\pbaumgar\MyCode\vagrants\awstest> vagrant up Bringing machine 'default' up with 'aws' provider... ==> default: Box 'dummy' could not be found. Attempting to find and install... default: Box Provider: aws default: Box Version: >= 0 ==> default: Box file was not detected as metadata. Adding it directly... ==> default: Adding box 'dummy' (v0) for provider: aws default: Downloading: dummy default: An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again.

Couldn't open file /C:/Users/pbaumgar/MyCode/vagrants/awstest/dummy

Ezekiel-Kruglick commented 8 years ago

@rob1256 solution worked for me.