Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong number of arguments (0 for 1) #5

Closed
mldoscar opened this issue Jan 8, 2016 · 1 comment
Closed

wrong number of arguments (0 for 1) #5

mldoscar opened this issue Jan 8, 2016 · 1 comment

Comments

@mldoscar
Copy link

mldoscar commented Jan 8, 2016

Hello, i'm using imgurapi-3.0.0, ruby 2.1.0, rails 4.2.4

I've linked my imgur account to my rails project successfully, but now I have the following issue:

The only problem I have is that I can't upload an image to Imgur server.
Once I write this code (pretty similar to imgurapi documentation):

img_url = "#{Rails.root}/public/images/user.jpg" #this is a valid and existent image file
@my_image = @imgur_session.image.image.upload(img_url) #line where exception is thrown

This Exception is thrown:

  • wrong number of arguments (0 for 1) on @imgur_session.image.image

It seems like a parameter must be set on the second '.image' property, like this:

@imgur_session.image.image(A_PARAMETER_HERE_IS_OBLIGATORY).upload(img_url)

but even if i set it as an empty string like: @imgur_session.image.image('') it will throw another exception like Please provide a valid image identificator, because what I want is to upload a picture, not showing an existent file.

I think there might be a way to correct this allowing no parameters in order to upload an image,
Please feel free to correct me, or help me,

Regards, my friends.

@mldoscar
Copy link
Author

mldoscar commented Jan 8, 2016

Oh, shh... Never mind.
I've found another post with the solution:
#3 (comment)

Regards

@mldoscar mldoscar closed this as completed Jan 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant