I am experimenting with connecting a Google Script to an IronWorker script.
Right now, I am just trying to get a "hello, world" level example to work.
My end goal is to pass data from Google Spreadsheets to an IronWorker for processing.
Right now, I just want to successfully POST to an IronWorker. Here's the Google Script function:
function myFunction() {
var arr = { "first" : "Chris", "last" : "Cruz" };
var url = 'https://worker-aws-us-east1.iron.io/2/projects/55c4f983e68185000600002b/tasks/webhook?code_name=hello-world-worker%3A%3Abuilder&oauth=mpPgu7iB0rT80iQ0mpCnCcy3nYE';
var options =
{
"method" : "post",
"data" : JSON.stringify(arr)
}
var response = UrlFetchApp.fetch(url, options);
Logger.log(response);
}
When I check the log in 'Hello, world»Workers»hello-world-worker::builder»Task #...10b44»Log', I see get this error output:
Successfully installed net-http-persistent-2.9.4
Successfully installed netrc-0.10.3
Successfully installed rest-3.0.6
Successfully installed iron_core-1.0.9
Successfully installed bundler-1.10.6
Successfully installed rubyzip-1.1.7
Successfully installed iron_worker_ng-1.6.6
7 gems installed
/usr/lib/ruby/1.9.1/json/common.rb:148:in `initialize': can't convert nil into String (TypeError)
from /usr/lib/ruby/1.9.1/json/common.rb:148:in `new'
from /usr/lib/ruby/1.9.1/json/common.rb:148:in `parse'
from /mnt/task/__builder__.rb:47:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from __runner__.rb:224:in `<main>'
I'm not sure where the error is being called from, so I don't know where to begin debugging. I'm running ruby version 2.0, and I did see this StackOverflow question: When will IronWorkers support Ruby 2.0?
I'm not sure if it's relevant, but the error output suggests it's a ruby problem.
Any thoughts would be greatly appreciated, thank you!