Ubuntu 18.10 does not recognize my Raspberry Pi

I'm trying to SSH on my Raspberry Pi Zero W. I set it up as an "Ethernet Gadget" so that I can SSH on it via USB. On Windows when I use PuTTY, it works, but the Ubuntu Bash keeps saying "No route to host" or "Could not resolve raspberrypi.local"

What am I doing wrong?