❯ irb
2.4.0 :001 > require 'iso_country_codes'
=> true
2.4.0 :002 > IsoCountryCodes.search_by_name('Belgie')
NoMethodError: undefined method `to_set' for ["AFGHANISTAN"]:Array
Did you mean? to_s
from /X/.rvm/gems/ruby-2.4.0/gems/iso_country_codes-0.7.8/lib/iso_country_codes/iso_country_codes.rb:94:in `word_set'
from /X/.rvm/gems/ruby-2.4.0/gems/iso_country_codes-0.7.8/lib/iso_country_codes/iso_country_codes.rb:44:in `block in search_by_name'
from /X/.rvm/gems/ruby-2.4.0/gems/iso_country_codes-0.7.8/lib/iso_country_codes/iso_country_codes.rb:44:in `select'
from /X/.rvm/gems/ruby-2.4.0/gems/iso_country_codes-0.7.8/lib/iso_country_codes/iso_country_codes.rb:44:in `search_by_name'
from (irb):2
from /X/.rvm/rubies/ruby-2.4.0/bin/irb:11:in `<main>'
What I did:
gem install 'iso_country_codes
irb
require 'iso_country_codes
IsoCountryCodes.search_by_name('Belgie')
What I expected:
BE
What I got: