undefined method 'associate_callback_target' #328

Closed
chaitanyav opened this Issue May 8, 2012 · 5 comments

Comments

Projects
None yet
5 participants

I had this error on my app using ruby-1.9.3-p194, eventmachine 0.12.10

/home/chaitanyav/blog/staging/shared/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/lib/em/connection.rb:39:inblock in new': undefined method associate_callback_target' for #<StarlingServer:: Handler:0x000000008a26b8> (NoMethodError)

When i opened up the the file lib/em/connection.rb, found that the associate_callback_target is commented out.

class Connection
    attr_accessor :signature # :nodoc:

    # Override .new so subclasses don't have to call super and can ignore
    # connection-specific arguments
    #
    def self.new(sig, *args) #:nodoc:
      allocate.instance_eval do
        # Store signature
        @signature = sig
        associate_callback_target sig

        # Call a superclass's #initialize if it has one
        initialize(*args)

        # post initialize callback
        post_init

        self
      end
    end

    # Stubbed initialize so legacy superclasses can safely call super
    #
    def initialize(*args) #:nodoc:
    end

    # def associate_callback_target(sig) #:nodoc:
    #   # no-op for the time being, to match similar no-op in rubymain.cpp
    # end

Had to uncomment the associate_callback_target method to get the gem working, Please make a new release of eventmachine since the latest version of this file has changed significantly.

frumioj commented Jun 28, 2012

I did the same thing to "fix" this issue in my local copy. Is anyone listening?

It may be a compile issue, associate_callback_target is define in the C code. But, it's a noop there as well.

https://github.com/eventmachine/eventmachine/blob/master/ext/rubymain.cpp#L1282
https://github.com/eventmachine/eventmachine/blob/master/ext/rubymain.cpp#L1034-1042

Contributor

tmm1 commented Aug 7, 2012

0.12.10 does not work on ruby 1.9. Please use a 1.0.0 release: gem install eventmachine --pre

0.12.10 works just fine on 1.9.3-p194. 1.0.x, on the other hand, not so great.

Contributor

tmm1 commented Feb 28, 2013

This is fixed in newer releases. Please report issues with 1.0.0 series. 0.12.10 has serious performance issues with ruby 1.9- I do not recommend using them together.

@tmm1 tmm1 closed this Feb 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment