Error compiling for board Arduino/Genuino Uno.How to fix this.

Arduino: 1.8.9 (Mac OS X), Board: "Arduino/Genuino Uno"

fork/exec /Users/waltermiles/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-g++: no such file or directory
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

What programmer do i click on in the Tools menu?

What programmer do i click on in the Tools menu?

Which one have you attached?

i have checked off the Arduino as ISP for the programmer but no matter which one I
use, I still get the same error message. It was worked fine, then all of a sudden I
can't compile anymore..

Ok, I repeat the question. Which one did you attach between your Computer and your Arduino? Is there only a USB cable or additional Hardware involved?

fork/exec /Users/waltermiles/Library/Arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-g++: no such file or directory
Error compiling for board Arduino/Genuino Uno.

It looks like it is saying that the compiler itself is not where it is supposed to be.

Try renaming or deleting this folder: /Users/waltermiles/Library/Arduino15/
And then re-install the Arduino IDE. Don't worry: It won't remove any of your sketches or third-party libraries.

JaBa, my Arduino is connected to my computer by way of a USB cable. I have switched
different cables and I still get the error message.

Then select the correct COM Port that connects your PC through the USB cable to the Arduino which is being programmed. Admittedly, I'm using Windows but in my IDE, I don't select a programmer at all, I use the menu Option "Port" and select the one used.

Thanks for the reply JaBa. I'm connected to a Mac and the right Port is checked off.I have a sketch
working on my Arduino but I can't change it due to the error.

I am having same issue, any solution for it yet?

JaBa, the person is having problems with the compilation of the code, not the programmer or the sketch uploading. I think that there is a library included in the code which does not support the Arduino UNO Board. Please send the code here so we can figure out what's the problem. Or tell what libraries you are using. They might also be the problem.