Skip to content
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 · 32 comments
Closed

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

northstjarna opened this issue Jul 26, 2015 · 32 comments

Comments

@northstjarna
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

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
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link
Contributor

Fixed by hashicorp/vagrant-installers#62 😄

@ewang
Copy link

ewang commented Aug 9, 2015

Will the installer on the downloads page be rebuilt?

@Niharika29
Copy link

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
Copy link

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

@calebfornari
Copy link

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
Copy link

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
Copy link

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
Copy link

YoungCR commented Sep 20, 2015

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

@cjchand
Copy link

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
Copy link

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
Copy link

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
Copy link
Contributor

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@benfinklea
Copy link

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
Copy link

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
Copy link

@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
Copy link

$> 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
Copy link

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

@ghost
Copy link

ghost commented Mar 31, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests