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

ArgumentError: wrong number of arguments (2 for 1) #4

Open
h0jeZvgoxFepBQ2C opened this issue May 13, 2016 · 3 comments
Open

ArgumentError: wrong number of arguments (2 for 1) #4

h0jeZvgoxFepBQ2C opened this issue May 13, 2016 · 3 comments

Comments

@h0jeZvgoxFepBQ2C
Copy link

Tried to implement your example at the end in your documentation (https://admin.gear.mycelium.com/docs/api/creating_orders), but it doesnt work... Any hints?

Thanks!

[8] pry(#<PaymentsController>)> client.orders.create(new_order)
ArgumentError: wrong number of arguments (2 for 1)
from /Users/myuser/.rvm/gems/ruby-2.1.8/gems/straight-server-kit-0.2.0/lib/straight-server-kit/resources/order_resource.rb:4:in `block in <class:OrderResource>'
@h0jeZvgoxFepBQ2C
Copy link
Author

h0jeZvgoxFepBQ2C commented May 13, 2016

Ah, ok.. It seems that the last (gem) release is quite out of date..
Worked when I changed lambda to proc / installed it via github reference:

# BROKEN
# installed normally in Gemfile, no mention of github repo
module StraightServerKit
  class OrderResource < ResourceKit::Resource

    API_ERROR_HANDLER = *lambda* do |response|
      raise ApiError.new(status: response.status, message: response.body)
    end

Works (more or less, see text below):

# WORKS
# installed via git in Gemfile 
# gem 'straight-server-kit', git: "[email protected]:MyceliumGear/straight-server-kit.git"

module StraightServerKit
  class OrderResource < ResourceKit::Resource

    API_ERROR_HANDLER = *proc* do |response|
      raise ApiError.new(status: response.status, message: response.body)
    end

Any hints if this is getting updated?

EDIT: Removed other exceptions here reporeted, since they origin was on my side

@gengkeye
Copy link

I changed lambda to proc as you said. Then the error "wrong number of arguments (2 for 1)" is disappeared. But I got another error:
StraightServerKit::ApiError: POST /gateways/1/orders Server Error
And the straight sever side displayed an error:
..Invalid Base58Check string: checksum invalid in "tpub..."
what's wrong with it?

@gengkeye
Copy link

Ah. I encountered this issue on my production environment. The host is ubuntu16. I modified lambda to proc but it didn't work this time. My local host is Centos7. It works well. Doesn't it support ubuntu16? And how to fix it?

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

2 participants