gimite / web-socket-ruby

HTML5 Web Socket server/client implementation in Ruby
375 stars 71 forks source link

ruby 1.8 encoding #3

Closed greenail closed 14 years ago

greenail commented 14 years ago

Looks like i'm getting issues with the json gem

NoMethodError: undefined method encoding' for "{\"data\"=>\"pong\", \"playerID\"=>\"1\"}":String from /usr/lib/ruby/gems/1.8/gems/json_pure-1.2.2/lib/json/pure/parser.rb:73:ininitialize' from /usr/lib/ruby/gems/1.8/gems/json_pure-1.2.2/lib/json/common.rb:128:in new' from /usr/lib/ruby/gems/1.8/gems/json_pure-1.2.2/lib/json/common.rb:128:inparse' from (irb):5

gimite commented 14 years ago

Thanks for the report. Pushed a change to define force_encoding wrapper in WebSocket class instead of defining String#force_encoding in Ruby 1.8, so hopefully the issue is fixed.