这是来自 Ruby Docs (1.9.3) 的示例代码
require 'socket'
require 'openssl'
tcp_client = TCPSocket.new 'localhost', 5000
ssl_client = OpenSSL::SSL::SSLSocket.new client_socket, context
ssl_client.connect
ssl_client.puts "hello server!"
puts ssl_client.gets
用 Ruby (1.9.3) 运行它会给我这个错误:
try.rb:4:in `<main>': undefined local variable or method `client_socket' for main:Object (NameError)
为什么 ?