Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Faraday conflict #114

Closed
danhunter opened this Issue · 4 comments

3 participants

@danhunter

I'm running the Instagram gem alongside the youtube_it gem so I can connect to both social networks.. Not sure if this is an issue with the Instagram gem or the youtube_it gem but..

It seems like they are suffering from conflicting Faraday middleware? I get the following output:

ArgumentError: wrong number of arguments (3 for 2)
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/youtube_it-2.1.7/lib/youtube_it/middleware/faraday_oauth2.rb:9:in `initialize'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/middleware.rb:21:in `new'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/middleware.rb:21:in `new'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/builder.rb:43:in `build'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/builder.rb:78:in `block in to_app'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/builder.rb:78:in `each'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/builder.rb:78:in `inject'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/builder.rb:78:in `to_app'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/connection.rb:74:in `app'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/connection.rb:226:in `run_request'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/faraday-0.8.4/lib/faraday/connection.rb:87:in `get'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/bundler/gems/instagram-ruby-gem-84f1a918e477/lib/instagram/request.rb:28:in `request'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/bundler/gems/instagram-ruby-gem-84f1a918e477/lib/instagram/request.rb:6:in `get'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/bundler/gems/instagram-ruby-gem-84f1a918e477/lib/instagram/client/users.rb:37:in `user_search'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/bundler/gems/instagram-ruby-gem-84f1a918e477/lib/instagram.rb:19:in `method_missing'
    from (irb):1
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

..when I try and run any Instagram request.

Using ruby 1.9.3-p125 and rails 3.2.8. The project also uses the Twitter gem (which also uses Faraday) but there are no conflicts with that.

Also posted here: Instagram/instagram-ruby-gem#48

@danhunter

I've prevented the error by re-ordering my Gemfile. Youtube_it is required to be added before the Instagram gem.. ?!

@chebyte chebyte closed this
@chebyte
Collaborator

maybe when you loaded instragram later overwrite some methods and works oks, I dont pretty sure but thanks for the advice

@apatlola

I got the same error and re-ordering of Gemfile resolved the error but I am getting a warning as below
/.rvm/gems/ruby-1.9.3-p327@appmanager/gems/faraday_middleware-0.9.0/lib/faraday_middleware/request/oauth2.rb:62: warning: already initialized constant OAuth2
How can I get rid of this?

@apatlola

Instagram/instagram-ruby-gem#53 This fixes the warning and conflict i.e no need to re-order Gemfile.

@danhunter danhunter referenced this issue in Instagram/instagram-ruby-gem
Closed

Faraday conflict #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.