2.1.1
Windows 10
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "centos/7"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "5.5.5.5"
end
I am having a strange issue where vagrant works fine for a while, and then all of a sudden it completely stops working and any vagrant commands I run, just give me: "Exec error: exec: "ruby": executable file not found in %PATH%"
It happened yesterday and after a restart didn't fix it, I uninstalled/reinstalled it and it started working again.
Today I've cmoe back to it and again it was working fine, I created a box, went in and did some stuff on it then destroyed it, then created another one, and all was working fine. Then I did a vagrant up on the new box i initialised... I got a lot of warnings, but it got there in the end:
default: Warning: Connection reset. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
default: Warning: Connection reset. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
default: SSH address: 127.0.0.1:2200
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Rsyncing folder: /cygdrive/m/Web/moodle/ => /vagrant
But now any vagrant command, inlcuding just vagrant itself, and all I get is:
"Exec error: exec: "ruby": executable file not found in %PATH%"
Nothing has changed on my PC from the time I ran vagrant up till now.
Can anyone help please?
Thanks.
I've just done another reinstall, and found that in /HashiCopr/Vagrant/embedded/mingw63/bin there is a "ruby.exe" file, which was missing before. When I checked when I was getting the error, there was only the "rubyw.exe", so something is deleting that ruby.exe file somehow, seemingly at random.
And again:
PS M:\Web\moodle> vagrant box add centos/7
==> box: Box file was not detected as metadata. Adding it directly...
A name is required when adding a box file directly. Please pass
the `--name` parameter to `vagrant box add`. See
`vagrant box add -h` for more help.
PS M:\Web\moodle> vagrant add box centos/7
Exec error: exec: "ruby": executable file not found in %PATH%
PS M:\Web\moodle>
Check before running the first command and ruby.exe was there, checked after getting the error and it's gone.
Hi there,
This is most likely caused by antivirus software running on your system that is quarantining the ruby executable.
Odd, I checked the list of files it's removed and though it had removed some from hashicorp (ssh.exe, rsync.exe and curl.exe) ruby.exe wasn't in there.
I've just installed ruby manaully from the rubyinstaller and added that to my path, which seems to have fixed it for now.
where did you download ruby installer from?
I have had the same problem and when i restored curl.exe file, it started working again
Closing this as it's due to third party software. Cheers!
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Hi there,
This is most likely caused by antivirus software running on your system that is quarantining the ruby executable.