{"action":"created","issue":{"url":"https://api.github.com/repos/faye/websocket-driver-ruby/issues/24","labels_url":"https://api.github.com/repos/faye/websocket-driver-ruby/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/faye/websocket-driver-ruby/issues/24/comments","events_url":"https://api.github.com/repos/faye/websocket-driver-ruby/issues/24/events","html_url":"https://github.com/faye/websocket-driver-ruby/issues/24","id":57587345,"number":24,"title":"getting undefined method using the websocket driver inside a capistrano task","user":{"login":"bogdanRada","id":1104923,"avatar_url":"https://avatars.githubusercontent.com/u/1104923?v=3","gravatar_id":"","url":"https://api.github.com/users/bogdanRada","html_url":"https://github.com/bogdanRada","followers_url":"https://api.github.com/users/bogdanRada/followers","following_url":"https://api.github.com/users/bogdanRada/following{/other_user}","gists_url":"https://api.github.com/users/bogdanRada/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdanRada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdanRada/subscriptions","organizations_url":"https://api.github.com/users/bogdanRada/orgs","repos_url":"https://api.github.com/users/bogdanRada/repos","events_url":"https://api.github.com/users/bogdanRada/events{/privacy}","received_events_url":"https://api.github.com/users/bogdanRada/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-02-13T11:18:12Z","updated_at":"2015-02-13T20:48:54Z","closed_at":null,"body":"I am currently using the faye gem for a project where i have a class:\r\n```ruby\r\n class FayeConnection\r\n  def initlalize\r\n     @client= Faye::Client.new(\"ws://www.example.com/faye\")\r\n end \r\n\r\n  def  publish(channel, message) \r\n    @client.publish(channel, 'text' => message)\r\n  end\r\nend\r\n\r\n```\r\n\r\n\r\nHowever if i use this class inside a capistrano task i get a undefined method . This is an example of a task i am using\r\n```ruby\r\n  task :do_something do\r\n   faye_client = FayeConnection.new\r\n  faye_client.publish('/work', \"a message\")\r\nend\r\n```\r\nAnd here is the error i am getting:\r\nNoMethodError: undefined method `[]' for #<Capistrano::Configuration:0x9717c18>\r\n\t/home/raul/.rvm/gems/ruby-2.1.5@project/gems/websocket-driver-0.5.1/lib/websocket/driver/hybi.rb:68:in `initialize'\r\n\t/home/raul/.rvm/gems/ruby-2.1.5@project/gems/websocket-driver-0.5.1/lib/websocket/driver/client.rb:12:in `initialize'\r\n\t/home/raul/.rvm/gems/ruby-2.1.5@project/gems/websocket-driver-0.5.1/lib/websocket/driver.rb:131:in `new'\r\n\t/home/raul/.rvm/gems/ruby-2.1.5@project/gems/websocket-driver-0.5.1/lib/websocket/driver.rb:131:in `client'\r\n\r\nCould you please look into this? I tried to find a solution but i didn't managed to get around this problem. if you need more information about this please let me know. Thank you very much.\r\n"},"comment":{"url":"https://api.github.com/repos/faye/websocket-driver-ruby/issues/comments/74324359","html_url":"https://github.com/faye/websocket-driver-ruby/issues/24#issuecomment-74324359","issue_url":"https://api.github.com/repos/faye/websocket-driver-ruby/issues/24","id":74324359,"user":{"login":"jcoglan","id":9265,"avatar_url":"https://avatars.githubusercontent.com/u/9265?v=3","gravatar_id":"","url":"https://api.github.com/users/jcoglan","html_url":"https://github.com/jcoglan","followers_url":"https://api.github.com/users/jcoglan/followers","following_url":"https://api.github.com/users/jcoglan/following{/other_user}","gists_url":"https://api.github.com/users/jcoglan/gists{/gist_id}","starred_url":"https://api.github.com/users/jcoglan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcoglan/subscriptions","organizations_url":"https://api.github.com/users/jcoglan/orgs","repos_url":"https://api.github.com/users/jcoglan/repos","events_url":"https://api.github.com/users/jcoglan/events{/privacy}","received_events_url":"https://api.github.com/users/jcoglan/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T20:48:54Z","updated_at":"2015-02-13T20:48:54Z","body":"Okay well you can make things work for now by doing this:\r\n\r\n```rb\r\nclass Faye::WebSocket::Client\r\n  undef_method :env\r\nend\r\n```\r\n\r\nOther than that I'm not sure what to do. If Capistrano pollutes all objects with new methods, that's going to render any duck-typing unworkable."}}