If using a yubikey and getting this:

gpg: selecting card failed: Operation not supported by device
gpg: OpenPGP card not available: Operation not supported by device

Add to ~/.gnupg/scdaemon.conf

disable-ccid

To debug you could use:

reader-port Yubico Yubi
debug-all
debug-level guru
disable-ccid
log-file /tmp/scd.log