adelevie / parse-ruby-client

A simple Ruby client for the parse.com REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

undefined method `file' for #<Parse::Client:0xaeb9740>

wonderer007 opened this issue · comments

I am trying to upload image file on parse database using example below

photo = client.file({
:body => IO.read("test/parsers.jpg"),
:local_filename => "parsers.jpg",
:content_type => "image/jpeg"
})
photo.save

But getting this error
undefined method `file' for #Parse::Client:0xaeb9740
Thanks

@wonderer007 which version of parse-ruby-client are you using?

i think its latest one as it included gem like
gem 'parse-ruby-client', git: 'https://github.com/adelevie/parse-ruby-client.git'
But i finally able to do it like this

photo = Parse::File.new({
:body => IO.read("/path/of/file"),
:local_filename => "wizard.jpg",
:content_type => "image/jpeg"
})
photo.save

@wonderer007 you probably have a revision that doesn't have that method yet. Do a bundle update parse-ruby-client on your project directory. The method is here: https://github.com/adelevie/parse-ruby-client/blob/master/lib/parse/client.rb#L102

I'm going to close this in the meantime, if you have any more problems keep commenting.

Thanks!