The following works:
$ zip -rj /the/absolute/path/tmp{.zip,}
It produced a file called tmp.zip, saving me the trouble to repeat the folder name as the name of the zip archive.
In my rifle.conf (ranger specific configuration file) I have:
!mime ^text, !ext xml|csv|tex|py|pl|rb|sh|php = zip -rj "$@"{.zip,}
The "$@" translates to the path. This works fine, I make use of this a lot.
But when I try it, the error I get is:
zip error: Nothing to do! (/the/absolute/path/tmp{.zip,})
This has worked fine for me, too. It only stopped working after upgrading my OS and with it ranger. So there is likely something I am missing here.
$ ranger --version
ranger version: ranger 1.9.3
Python version: 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
Locale: en_US.UTF-8
$ cat /etc/upstream-release/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu Focal Fossa"