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

Presence-Channel subscriptions throwing "ArgumentError: wrong number of arguments (2 for 1)" #8

Open
neilcauldwell opened this issue May 16, 2012 · 6 comments

Comments

@neilcauldwell
Copy link

Subscribing to a presence-channel or private-channel throws a "ArgumentError: wrong number of arguments (2 for 1)", but public channel subscriptions are working just fine. There's more info and code on this post on Stack Overflow http://stackoverflow.com/questions/10581398/pusher-client-gem-throwing-2-for-1-error-with-presence-channels . Presumably the presence/private subscription prefix isn't being identified for some reason, thus leading to the subscribe method assuming that the USER_ID shouldn't be there.

@kieranklaassen
Copy link

Same thing here. I want to subscribe to a private channel.
wrong number of arguments (2 for 1) (ArgumentError)

@neilcauldwell
Copy link
Author

@kieranklaassen what version of Ruby / Rails are you running? This is ruby 1.8.7 Ruby Enterprise Edition 2010.02, Rails 2.3.14

@kieranklaassen
Copy link

I'm on 1.9.2. But I think this just not in the gem code:

Socket.rb

def subscribe(channel_name)
      channel = @channels << channel_name
      if @connected
        send_event('pusher:subscribe', {
          'channel' => channel.name
        })
        channel.acknowledge_subscription(nil)
      end
      return channel
    end

@kieranklaassen
Copy link

Solution:

gem 'pusher-client', :git => "https://github.com/logankoester/pusher-client.git"

@neilcauldwell
Copy link
Author

@kieranklaassen Thanks. Did you include that in your gem file? I'm seeing this:

$ bundle install
Fetching https://github.com/logankoester/pusher-client.git
error: The requested URL returned error: 403 while accessing https://github.com/logankoester/pusher-client.git/info/refs

@neilcauldwell
Copy link
Author

Had to specify a git url in gemfile:
gem 'pusher-client', :git => "git://github.com/logankoester/pusher-client.git"

However, it looks as though I'll be using this fork to get access to the :user_info semarco@39ae057

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