macospathvmwarefusionvmware-fusion

Getting `No such file or directory` when executing any terminal command (caused by VMware Fusion)


I am using macOS High Sierra and I am getting the following error when trying to install a script:

 sh: Fusion.app/Contents/Public:/Users/<name>/.rvm/bin: No such file or directory

Apparently has something to do either with rvm or Fusion.app, which I don't have that app, what I have is VMWare Fusion.app.


Solution

  • VMWare changes your $PATH variable, but it does not do in .profile, or /etc/profile, neither the globals or locals bashrc or zshrc files.

    It has its own file inside /etc/paths.d. The file is called com.vmware.fusion.public.

    You need sudo rights to change the file:

    $ sudo vim /etc/paths.d/com.vmware.fusion.public
    

    The file is readonly and it has as content:

    /Applications/VMware Fusion.app/Contents/Public
    

    Notice there are not quotes around it, and the space character is not escaped. You need to add a \ after the VMWare and before the white space.

    Final result:

    /Applications/VMware\ Fusion.app/Contents/Public
    

    Quit vim with :x!.

    Open a new terminal window and run your command again, you should not have that error anymore.