title: Ruby - unsupported cipher algorithm (AES-256-GCM)
body: <p>I'm getting the error:</p>
  
  <blockquote>
    <p>unsupported cipher algorithm (AES-256-GCM) (RuntimeError)</p>
  </blockquote>
  
  <p>But I seem to have all the requirements:</p>
  
  <p>Ruby version:</p>
  
  <blockquote>
    <p>$ ruby --version</p>
    
    <p>ruby 2.1.2p95</p>
  </blockquote>
  
  <p>OpenSSL does list gcm:</p>
  
  <blockquote>
    <p>$ openssl enc -help 2>&amp;1 | grep gcm</p>
    
    <p>-aes-128-ecb               -aes-128-gcm               -aes-128-ofb<br>
    -aes-192-ecb               -aes-192-gcm               -aes-192-ofb<br>
    -aes-256-ecb               -aes-256-gcm               -aes-256-ofb </p>
  </blockquote>
  
  <p>Ruby interpreter:</p>
  
  <blockquote>
    <p>$ irb</p>
    
    <p>2.1.2 :001 > require 'openssl'; puts OpenSSL::VERSION</p>
    
    <p>1.1.0</p>
    
    <p>=> nil</p>
    
    <p>2.1.2 :002 > OpenSSL::Cipher.ciphers.include? "aes-128-gcm"</p>
    
    <p>=> true </p>
  </blockquote>
  
  <p>And yet I'm getting errors running this <a href="http://www.ruby-doc.org/stdlib-2.1.2/libdoc/openssl/rdoc/OpenSSL/Cipher.html">code</a>:</p>
  
  <pre><code>2.1.2 :001 &gt; require 'openssl'
   =&gt; true 
  2.1.2 :002 &gt; cipher = OpenSSL::Cipher::AES.new(128, :GCM)
  RuntimeError: unsupported cipher algorithm (AES-128-GCM)
      from /home/m/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/openssl/cipher.rb:27:in `initialize'
      from /home/m/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/openssl/cipher.rb:27:in `block (3 levels) in &lt;class:Cipher&gt;'
      from (irb):2:in `new'
      from (irb):2
      from /home/m/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `&lt;main&gt;'
  </code></pre>
  
  <p>How do I get GCM to work in ruby?</p>