I ended up using google instead
client = Google::APIClient.new(:authorization => nil)
google_search = client.discovered_api('customsearch', 'v1')
google_result = client.execute(
:api_method => google_search.cse.list,
:authenticated => false,
:parameters => {
'q' => query,
'key' => key, # your key received from google
'siteSearch' => query_params[1],
'cx' => cx, # your cx code received from google
'num' => 1
}
)