"Super on the singleton method, which is defined for several classes, is not supported."

I am trying to use the Steam Condenser library with Ruby 1.9.2 and Rails 3.

I have the following code:

require "steam/servers/source_server" 

class HomeController < ApplicationController
  def index
    server = SourceServer.new(IPAddr.new("127.0.0.1"), 2000)
    server.init

    @m = server.get_players
  end
end

but for some reason he throws:

super from the singleton method, which is defined for several classes, is not supported; it will be fixed in 1.9.3 or later

... in line 5: server = SourceServer.new(IPAddr.new("127.0.0.1"), 2000).

How to fix it?

+3
source share
2 answers

I am the creator of Steam Condenser.

This is a flaw in Ruby 1.9.2 (as indicated in the error message). There already exists a workaround for this problem .

( Ruby) .

+2

Source: https://habr.com/ru/post/1767993/


All Articles