brandonhilkert / sucker_punch

Sucker Punch is a Ruby asynchronous processing library using concurrent-ruby, heavily influenced by Sidekiq and girl_friday.
MIT License
2.64k stars 114 forks source link

superclass mismatch for class ActorProxy (TypeError) when using 'sucker_punch/testing/inline' #30

Closed kfatehi closed 11 years ago

kfatehi commented 11 years ago

Hi here is my backtrace when running my specs on this version of my program. I might figure it out but I thought I'd leave this note.

➜  bait git:(27_async_jobs) ✗ rspec spec
/Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:4:in `<module:Celluloid>': superclass mismatch for class ActorProxy (TypeError)
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:1:in `<top (required)>'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require_with_backports'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/celluloid-0.14.1/lib/celluloid.rb:518:in `<top (required)>'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require_with_backports'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/sucker_punch-1.0.1/lib/sucker_punch.rb:1:in `<top (required)>'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require_with_backports'
    from /Users/keyvan/bait/lib/bait/tester.rb:5:in `<top (required)>'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require_with_backports'
    from /Users/keyvan/bait/lib/bait/build.rb:2:in `<top (required)>'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/backports-3.3.3/lib/backports/tools.rb:328:in `require_with_backports'
    from /Users/keyvan/bait/lib/bait/api.rb:5:in `<top (required)>'
    from /Users/keyvan/bait/spec/lib/bait/api_spec.rb:2:in `require'
    from /Users/keyvan/bait/spec/lib/bait/api_spec.rb:2:in `<top (required)>'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `load'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `each'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `load_spec_files'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.4/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.4/lib/rspec/core/runner.rb:80:in `run'
    from /Users/keyvan/.rvm/gems/ruby-2.0.0-p247/gems/rspec-core-2.14.4/lib/rspec/core/runner.rb:17:in `block in autorun'
Coverage report generated for RSpec to /Users/keyvan/bait/coverage. 44 / 184 LOC (23.91%) covered.
➜  bait git:(27_async_jobs) ✗
brandonhilkert commented 11 years ago

Did you find the cause of this?

kfatehi commented 11 years ago

No unfortunately

brandonhilkert commented 11 years ago

I couldn't find anything obvious. It might be worth asking on the Celluloid group if you're still interested in going down that path. https://groups.google.com/forum/#!forum/celluloid-ruby

dlackty commented 11 years ago

Hello, @keyvanfatehi I just ran into the same issue this afternoon, and found that it's because you might probably

require File.expand_path("../../config/environment", __FILE__)

after

require 'sucker_punch/testing/inline'

After putting testing/inline after environment, everything works fine again.

brandonhilkert commented 11 years ago

@dlackty Thanks for the feedback. Sure enough, adding require 'sucker_punch' before require 'sucker_punch/testing/inline' resolved the issue.