New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug vagrant: command not found after install on Mac OSX 10.10.4 #6034

Closed
northstjarna opened this Issue Jul 26, 2015 · 31 comments

Comments

Projects
None yet
@northstjarna

northstjarna commented Jul 26, 2015

Hi There,

Downloaded Vagrant, and went through th installation process.
When I ran vagrant -v it says vagrant: command not found
It has put the files in /opt/vagrant/...

It should install in the Applications folder with a link to the /usr/bin so it is added to the shell path.
There is no directory that has been created during this process.
I am afraid I can't even get started with it. ITs obviously not creating all the shortcuts it needs to be able to run the commands.

screen-shot-2015-07-26-at-09 22 13

@sethvargo

This comment has been minimized.

Contributor

sethvargo commented Jul 26, 2015

Hi @northstjarna

I am sorry you are having issues with Vagrant. Do you have /usr/local/bin in your $PATH? OS X El Capitan does not permit us to put files in /usr/bin anymore, so we moved to /usr/local/bin.

@northstjarna

This comment has been minimized.

northstjarna commented Jul 26, 2015

Hi there,
No i have no directory under usr
Andis-iMac:usr andileedavis$ ls -la
total 8
drwxr-xr-x@ 10 root wheel 340 29 Jan 14:26 .
drwxr-xr-x 35 root wheel 1258 26 Jul 09:32 ..
drwxr-xr-x 5 root wheel 170 9 Sep 2014 X11
lrwxr-xr-x 1 root wheel 3 29 Jan 14:26 X11R6 -> X11
drwxr-xr-x 1059 root wheel 36006 26 Jul 09:29 bin
drwxr-xr-x 250 root wheel 8500 5 Jul 11:08 lib
drwxr-xr-x 169 root wheel 5746 26 Jul 09:29 libexec
drwxr-xr-x 245 root wheel 8330 5 Jul 11:08 sbin
drwxr-xr-x 43 root wheel 1462 29 Jan 14:25 share
drwxr-xr-x 4 root wheel 136 29 Jan 14:21 standalone
Andis-iMac:usr andileedavis$

@northstjarna

This comment has been minimized.

northstjarna commented Jul 26, 2015

There seems to be an Apple issue. You may want to include a check for this directory and create it if not exists. OSX El Captain... :o)

@phonicfrank

This comment has been minimized.

phonicfrank commented Jul 26, 2015

I actually had the same issue on OSX 10.10.4 Yosemite . Vagrant was installed using the installer today.

Running the command vagrant will give me the error -bash: vagrant: command not found

I checked the content of the /usr/local/bin folder and can see vagrant in there. Using ls -la it lists vagrant as :

lrwxr-xr-x   1 root     admin        24 27 Jul 01:15 vagrant -> /opt/vagrant/bin/vagrant

The /opt folder is not accessible for me. It gave me a permission denied error when I ran cd /opt/vagrant/bin. I had to manually change the permission on that folder to make vagrant work.

chmod 755 -R /opt/vagrant
@northstjarna

This comment has been minimized.

northstjarna commented Jul 26, 2015

More disturbing is the fact that I do not have a directory /usr/local

@sethvargo sethvargo added the bug label Jul 26, 2015

@sethvargo sethvargo added this to the 1.8 milestone Jul 26, 2015

@northstjarna

This comment has been minimized.

northstjarna commented Jul 26, 2015

Definately an Apple issue.

I had to create the local directory.

sudo mkdir /usr/local

Then bin.

cd /usr/local
sudo mkdir bin

I uninstalled Vagrant, re-installed and when I ran vagrant -v I then got the version.

I had to go to that directory and then I ran the command provided by @phonicfrank

cd /usr/local/bin
ls
sudo chmod 755 vagrant

Thanks for all your help.

@pingwhistle

This comment has been minimized.

pingwhistle commented Jul 31, 2015

Weird, my /usr/local directory exists, but I had to correct the symlink in /usr/bin/vagrant from /Applications/Vagrant/something to /opt/vagrant/bin/vagrant:

$> sudo rm /usr/bin/vagrant
$> sudo ln -s /opt/vagrant/bin/vagrant /usr/bin/vagrant

This was for v1.7.4, not sure which version I upgraded from.

@jhenry82

This comment has been minimized.

jhenry82 commented Aug 4, 2015

I just tried to install Vagrant 1.7.4 on a brand new Mac running a fresh install of Yosemite. The /usr/local/ dir tree did not exist at all (and neither, obviously, did /usr/local/bin). Vagrant claimed to install successfully but could not be found on my path.

Manually creating /usr/local/bin and rerunning the installer fixed things up. Seems like it is not safe for the installer to assume that /usr/local and /usr/local/bin exist on modern Macs.

@dexter505

This comment has been minimized.

dexter505 commented Aug 4, 2015

I have Vagrant in /usr/local/bin. But it is not in my applications folder and I have to run PhpStorm via sudo and point it to the /usr/local/bin/vagrant executable for its vagrant tools to function properly. I tried uninstalling Vagrant and installing again, same result.

Vagrant 1.7.4
Mac OS X Yosemite Version 10.10.4

@jrtaylor-com

This comment has been minimized.

jrtaylor-com commented Aug 6, 2015

I had the same issue with a new MBP running Yosemite 10.10.3
I ran Vagrant's install then VirtualBox. It appeared that VirtualBox created the folder in /usr/local/bin so running the Vagrant install afterwords worked.

@sethvargo

This comment has been minimized.

Contributor

sethvargo commented Aug 6, 2015

@sethvargo sethvargo closed this Aug 6, 2015

@ewang

This comment has been minimized.

ewang commented Aug 9, 2015

Will the installer on the downloads page be rebuilt?

@Niharika29

This comment has been minimized.

Niharika29 commented Aug 20, 2015

I ran into this problem today. Managed to find this link by sheer luck. I didn't have /usr/local/bin, which I had to create myself and then run vagrant installer.

@timmillwood

This comment has been minimized.

timmillwood commented Aug 27, 2015

I had to run hash -d vagrant to tell bash that vagrant had moved from /usr/bin/vagrant to /usr/local/bin/vagrant.

@calebfornari

This comment has been minimized.

calebfornari commented Sep 5, 2015

I also just ran into this issue, adding /usr/local/bin and then re-running the installer fixed it. When will the downloaded installer be updated?

@CodeStrumpet

This comment has been minimized.

CodeStrumpet commented Sep 14, 2015

One more data point:

I also had to uninstall vagrant and then create the /usr/local/bin directory and then reinstall.

I'm running 10.10.2 (14C500)

@chai

This comment has been minimized.

chai commented Sep 16, 2015

Just wanted to add.
Had the same issue installing vagrant on os 10.10.5. Had to uninstall, manually create /usr/local/bin and reinstall using installer.

@YoungCR

This comment has been minimized.

YoungCR commented Sep 20, 2015

Also experienced same issues on 10.10.5, fixed by creating /usr/local/bin

@cjchand

This comment has been minimized.

cjchand commented Sep 22, 2015

Just chiming in with a "me, too" on a new 10.10.5 install (technically migration from 10.10.5 on another Macbook Pro). As with the others, manually creating /usr/local/bin and reinstalling did the trick.

@heikemerkel

This comment has been minimized.

heikemerkel commented Sep 29, 2015

This for me too: my /usr/local directory exists, but I had to correct the symlink in /usr/bin/vagrant from /Applications/Vagrant/something to /opt/vagrant/bin/vagrant:

$> sudo rm /usr/bin/vagrant
$> sudo ln -s /opt/vagrant/bin/vagrant /usr/bin/vagrant

@aworstell

This comment has been minimized.

aworstell commented Oct 6, 2015

Brand new OSX 10.11 Macbook Pro, had to manually add /usr/local/bin/ before running the installer. @sethvargo , bug does not appear to be fixed according to this and the previous comments.

@beporter

This comment has been minimized.

Contributor

beporter commented Oct 13, 2015

Another confirmation in 10.10. If /usr/local/bin doesn't exist, installation claims to succeed but the vagrant binary isn't actually installed. Running sudo mkdir -p /usr/local/bin before retrying the installation sorted it out.

@ghost

This comment has been minimized.

ghost commented Oct 15, 2015

I had the same problem on a brand new MacBook Pro, OSX 10.10.5 and had the same problem of the /usr/local directory not existing. I ran the following to fix it:

  1. sudo mkdir /usr/local
  2. sudo mkdir /usr/local/bin
  3. Ran the Vagrant uninstall.tool file to uninstall it
  4. Re-installed Vagrant
  5. Ran vagrant -v and received 1.7.4

All is working now.

@drusepth

This comment has been minimized.

drusepth commented Nov 2, 2015

Just received this error on a brand new 13" MBP running a fresh 10.11 El Capitan install. Running @andrewmiro's instructions worked perfectly.

@Generic42

This comment has been minimized.

Generic42 commented Nov 6, 2015

Same issue as as those above In 10.11. If /usr/local/bin doesn't exist, installation claims to succeed but the vagrant binary isn't actually installed. Running sudo mkdir -p /usr/local/bin before retrying the installation sorted it out.

@alex-moreno

This comment has been minimized.

alex-moreno commented Nov 21, 2015

same issue, /usr/local/ does not exist. Simply creating the folder and re-installing did the trick

@benfinklea

This comment has been minimized.

benfinklea commented Jun 13, 2016

Running 10.11.5. I had to set /usr/local/bin to read and writable by everyone. Seems like a security risk to me. Is there another way?

@yuseferi

This comment has been minimized.

yuseferi commented Sep 3, 2016

I resolove my problem with

$> sudo rm /usr/bin/vagrant
$> sudo ln -s /opt/vagrant/bin/vagrant /usr/bin/vagrant
$> sudo chmod +x /usr/bin/vargant
@ttranguy

This comment has been minimized.

ttranguy commented Nov 23, 2016

@zhilevan solutions fixed it for me!
In my case, the installer didn't create /usr/bin/vagrant
So I just had to create the symlink and chmod permissions.

@FreudGit

This comment has been minimized.

FreudGit commented Nov 23, 2016

$> sudo rm /usr/bin/vagrant = work perfectly, but I now get "default: sh: netsh: command not found" at the end uf the script. (I'm in macOS)

Any idea?

Thanks

==> default: Running triggers after up...
==> default: Executing command "vagrant ssh -c vagrant_up"...
==> default: sh: netsh: command not found
==> default: sh: cscript: command not found
==> default: It seems that you don't have the privileges to change the firewall rules. NFS will not work without that firewall
==> default: changes. Execute the following commands via cmd as administrator:
==> default: netsh advfirewall firewall add rule name="VagrantWinNFSd-1.3.1" dir="in" action=allow protocol=any program="\Users\Francois\.vagrant.d\gems\gems\vagrant-winnfsd-1.3.1\bin\winnfsd.exe" profile=any
==> default: netsh advfirewall firewall add rule name="VagrantWinNFSd-1.3.1" dir="out" action=allow protocol=any program="\Users\Francois\.vagrant.d\gems\gems\vagrant-winnfsd-1.3.1\bin\winnfsd.exe" profile=any
==> default: If you are an Windows XP user run the following command instead:
==> default: netsh firewall add allowedprogram "\Users\Francois\.vagrant.d\gems\gems\vagrant-winnfsd-1.3.1\bin\winnfsd.exe" VagrantWinNFSd-1.3.1 ENABLE
@saifuddin2018

This comment has been minimized.

saifuddin2018 commented Jun 14, 2018

@FreudGit , did you get a solution, i also face the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment