This probably isn't doing what you think it is. Since you're putting your key/value pairs inside of square brackets, it winds up being an array of one hash (other languages call them maps and dictionaries). Probably you want to exchange your square brackets with curly brackets like this:
servers = []
servers[0] = {'hostname' => 'unknown01', 'ip' => '192.168.0.2', 'port' => '22'}
servers[1] = {'hostname' => 'unknown02', 'ip' => '192.168.0.3', 'port' => '23'}
servers[2] = {'hostname' => 'unknown03', 'ip' => '192.168.0.4', 'port' => '24'}
But since you're just setting each one by its index, you don't need to build it up this way, you can just place them in their respective positions within the array.
servers = [
{'hostname' => 'unknown01', 'ip' => '192.168.0.2', 'port' => '22'},
{'hostname' => 'unknown02', 'ip' => '192.168.0.3', 'port' => '23'},
{'hostname' => 'unknown03', 'ip' => '192.168.0.4', 'port' => '24'},
]
Then to iterate over each one you can do:
servers.each do |server|
puts server['hostname']
puts server['ip']
puts
end