Q:

Ruby: unexpected ',', expecting keyword_end

Very new to Ruby, unable to see the titular syntax error in this bit of code:
#! /usr/bin/env ruby                                                               

require 'sensu-plugin/metric/cli'                                                  

class MetricAvailableUpdates < Sensu::Plugin::Metric::CLI::Graphite                

  option :scheme,                                                                  
    description: 'Metric naming scheme',                                           
    long: '--scheme SCHEME',                                                       
    short: '-s SCHEME',                                                            
    default: "#{Socket.gethostname}"                                               

  def run                                                                          
    # Get the metrics.                                                             
    output = %x[/usr/lib/update-notifier/apt-check --human-readable]               
    output_lines = output.split(/(\n)/)                                            

    metrics = {}                                                                   

    updates_pattern = " packages can be updated."                                  
    updates = output_lines[0].tr(upgrades_pattern, "").to_i                        
    metrics[:available_updates] = updates                                          

    security_updates_pattern = " updates are security updates."                    
    security_updates = output_lines[2].tr(security_updates_pattern, "").to_i       
    metrics[:available_security_updates] = security_updates                        

    # Print them in graphite format.                                               
    metrics.each do |k, v|                                                         
      output [config[:scheme], k].join('.'), v                                     
    end                                                                            

    # Done                                                                         
    ok                                                                             
  end                                                                              

end 

I can add the code that precedes this if the syntax error is in fact before this section. Edit: added complete file contents per comment request
The complete error, in case that is useful:
./metrics-available-updates.rb:29: syntax error, unexpected ',', expecting keyword_end
      output [config[:scheme], k].join('.'), v

A:

If you play around a bit, you will notice that the syntax error goes away either when you comment out the offending line, or alternatively the line 
output = %x[/usr/lib/update-notifier/apt-check --human-readable] 

When Ruby parses a file, it needs to guess, whether a symbol denotes a method call, or a variable reference. In this case, output springs into existence as a variable, but further down, you write 
output [config[:scheme], k].join('.'), v

which means it suddenly becomes a method call.
I admit that the Ruby lexer should give a more helpful error message....

