Using the nfc gem

require 'nfc'

# Create a new context
ctx =

# Open the first available USB device
dev = nil

# Block until a tag is available, then print tag info
r =

=> (NFC) ISO14443A Tag
 ATQA (SENS_RES): 00  04
    UID (NFCID1): 9D  42  4E  7C
   SAK (SEL_RES): 08
r.class    #=> NFC::ISO14443A
r.uid      #=> [157, 66, 78, 124]
r.uid.join #=> "1576678124"

# It can also be used in a continuous loop

loop do

Note: To terminate the loop I had to kill the IRB session. The other way is to use CTRL+C and then swipe the RFID tag across the reader.