title: Get CGI params (query_string, path_info, etc) in Ruby
body: <p>I'm trying to get the query_string from a Ruby file. For example;</p>
  
  <p><a href="http://localhost/rubyfile.rb?hello=world" rel="nofollow noreferrer">http://localhost/rubyfile.rb?hello=world</a></p>
  
  <p>I would like to be able to ask what's hello and for it to print "world", but for the life of me I cannot find the correct syntax/way to do it anywhere. Even the Ruby documentation seems dazed.</p>
  
  <pre><code>#!/program files (x86)/ruby/bin/ruby
  
  require 'cgi'
  cgi_request = CGI::new("html4")
  </code></pre>
  
  <p>This simply starts a new CGI spawn when the file is run, but how do I find the query_string?</p>
  
  <pre><code>puts cgi.params[query_string]
  </code></pre>
  
  <p>Doesn't seem to work-- I assume there is something i'm completly missing and im stupid but...</p>
  
  <p>It should be simple, shouldn't it?</p>
  
  <p>Thanks</p>