Archived from the Transloadit support forum. Originally posted on September 10, 2012; details may be outdated, see our docs for current behavior. Original thread
Having some issues with the ruby gem:
NoMethodError:
undefined method `[]' for nil:NilClass
# ./lib/image_helper.rb:51:in `save_image'
The code in the helper looks like this:
def save_image(user_id)
transloadit = Transloadit.new(
:key => 'xxx',
:secret => 'xxx'
)
transloadit.assembly(
:template_id => "xxx",
:fields => {
importUrl: "http://graph.facebook.com/#{user_id}/picture?type=large",
exportUrl: "users2/#{user_id}.jpg"
}
).submit!
It’s the submit! that makes the exception happen. If I add open(‘…’) after the submit!, it works fine. But since I’m using the http/import robot in the template, I dont have a file to pass in the open method.