プッシャー クライアントの rubygem は、パブリック チャネルをサブスクライブするときは正常に動作しますが、プレゼンスまたはプライベート チャネルをサブスクライブしようとすると、「ArgumentError: 引数の数が間違っています (2 対 1)」がスローされます。これは他の誰かにも起こりますか?
module PusherClientTest
require 'pusher-client'
PusherClient.logger = Logger.new(STDOUT)
options = { :secret => '12345' }
socket = PusherClient::Socket.new("54321", options)
USER_ID = 1
socket.subscribe('presence-TestChannel', USER_ID)
socket.bind('remark') do |data|
puts data
end
socket.connect
end
結果:
ree-1.8.7-2010.02 > PusherClientTest
ArgumentError: wrong number of arguments (2 for 1)
from /Users/Dev/Sites/test_app/app/models/pusher_client_test.rb:16:in `subscribe'
from /Users/Dev/Sites/test_app/app/models/pusher_client_test.rb:16
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:406:in `load_without_new_constant_marking'
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:406:in `load_file'
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:405:in `load_file'
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:285:in `require_or_load'
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:451:in `load_missing_constant'
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:106:in `const_missing_not_from_s3_library'
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing'
from /Users/Dev/.rvm/gems/ree-1.8.7-2010.02@test_app/gems/activesupport-2.3.14/lib/active_support/dependencies.rb:118:in `const_missing'
from (irb):1