Ruby - unsupported cipher algorithm (AES-256-GCM)

What works for me is

OpenSSL::Cipher.new('aes-128-gcm')

I am not sure why you get an error with your approach.

Edit:

It might be a upper/lower case issue. This might be an actual bug.

The following works:

OpenSSL::Cipher::AES.new(128, :CBC)

because we find "AES-128-CBC" (all upper case) in OpenSSL::Cipher::AES.ciphers. AES.new seems to search its ciphers with upper case characters.

Thus, the following does not work:

OpenSSL::Cipher::AES.new(128, :GCM)

because it is "aes-128-gcm" in the ciphers list.