4

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.

gabidavila
  • 992
  • 1
  • 9
  • 17

3 Answers3

14

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.

DimiDak
  • 4,820
  • 2
  • 26
  • 32
gabidavila
  • 992
  • 1
  • 9
  • 17
  • 3
    Unfortunately newer versions of VMware Fusion now rewrite this value every time it is launched. It's quite annoying. The only solution right now is to rename the application itself to "VMWare-Fusion.app" or "VMWareFusion.app" (for example) – Steve C Feb 18 '19 at 02:33
  • Should someone let them know so that this doe not come back with every update?... – DimiDak Nov 04 '21 at 15:32
  • I just checked with the VMware Fusion team and posted [my answer](https://stackoverflow.com/a/71109863/167362) below. – A B Feb 14 '22 at 09:53
1

With VMware Fusion rewriting /etc/paths.d/com.vmware.fusion.public on launch;

Adding this PATH find and replace line to my .bash_profile seems to be working:

export PATH=${PATH//VMware\ F/VMware\\ F}

0

This happens because some shell script (in this case perhaps rvm) is not following best practices, specifically:

Double quote to prevent globbing and word splitting https://github.com/koalaman/shellcheck/wiki/SC2086

Changing /etc/paths.d/com.vmware.fusion.public as suggested in other answers could break all other places where this variable is wrapped in double quotes.

A B
  • 2,013
  • 2
  • 21
  • 22