I'd do
hash = {"geo_locations"=>{"countries"=>["US", "GB", "AR"]}, "genders" =>[1, 2]}
countries = hash["geo_locations"]["countries"]
genders = hash['genders']
array_of_hashes = countries.product(genders).map do |val1,val2|
{"geo_locations" => { "countries" => val1 }, "genders" => [val2] }
end
array_of_hashes
# => [{"geo_locations"=>{"countries"=>"US"}, "genders"=>[1]},
# {"geo_locations"=>{"countries"=>"US"}, "genders"=>[2]},
# {"geo_locations"=>{"countries"=>"GB"}, "genders"=>[1]},
# {"geo_locations"=>{"countries"=>"GB"}, "genders"=>[2]},
# {"geo_locations"=>{"countries"=>"AR"}, "genders"=>[1]},
# {"geo_locations"=>{"countries"=>"AR"}, "genders"=>[2]}]