아니,하지 오류가. 그것이 작동하는 방식입니다. 당신이 값을 입력하기 위해 IRB 콘솔에서 ruby-docs CGI documentation
If the CGI object is not created in a standard CGI call environment (that is, it can’t locate REQUEST_METHOD in its environment), then it will run in “offline” mode. In this mode, it reads its parameters from the command line or (failing that) from standard input
에서
는 (offline mode: enter name=value pairs on standard input)
메시지 후, 콘솔이 기다리고 있습니다. key value pairs
을 입력 한 다음 을 입력하고 데이터 입력을 마치려면 Ctrld을 입력하십시오.
irb(main):001:0> require 'cgi'
=> true
irb(main):002:0> cgi = CGI.new
(offline mode: enter name=value pairs on standard input)
name=Prakash
number=432
=> #<CGI:0x007fa4eb2abd30 @options={:accept_charset=>"UTF-8"}, @accept_charset="UTF-8", @multipart=false, @params={"name"=>["Prakash"], "number"=>["432"]}, @cookies={}, @output_cookies=nil, @output_hidden=nil>
irb(main):003:0>
루비에서 CGI 작업의 상기 코드 예제 CGI Programming Documentation on PLEAC-Ruby 참조 Ctrl 키D. Win7에 +에 WEBrick 서버를 사용
되 잖아, 내 코드는 다음과 같습니다 <% Encoding.compatible % ("\ XA1"("ISO-8859-1"), "B".force_encoding)?> Sessão = "Darlan" %> <% = "오이, 세션 # {["이름 "]}"%> <% session.close 것은 Session.delete %> –
zezzão
CGI :: Session.new (cgi, "prefix"=> "rubysession")I가 CRTL 사용할 때마다 + D? –