Skip to content

Bug: uninitialized constant WebMock::Util::HashCounter::Mutex #254

Closed
moonglum opened this Issue Feb 18, 2013 · 11 comments

2 participants

@moonglum

This occurs on version 1.9.1 and 1.9.2 of WebMock, and runs fine on 1.9.0. This error only occurs on 1.8.7 and compatible Rubies (JRuby and Rubinius) – no problems on 1.9. The error is as follows:

Failure/Error: Unable to find matching line from backtrace
NameError:
  uninitialized constant WebMock::Util::HashCounter::Mutex

Example for a failing run can be found here.

@bblimke
Owner
bblimke commented Feb 19, 2013

@moonglum, can you please check if webmock from master branch fixes this issue?

@moonglum

Of course!

It's now uninitialized constant Mutex instead of uninitialized constant WebMock::Util::HashCounter::Mutex, but nothing else changed.

@bblimke
Owner
bblimke commented Feb 20, 2013

Ok, it looks like 'thread' needs to be required to have access to Mutex. I updated master, try it now.

@moonglum

The error changed again ;) Here is the log from running my Raketask:

/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock/util/hash_counter.rb:1:in `require': no such file to load -- mutex (LoadError)
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock/util/hash_counter.rb:1
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock.rb:14:in `require'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock.rb:14
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock/rspec.rb:1:in `require'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock/rspec.rb:1
        from /Users/moonglum/Code/ashikawa-core/spec/unit/spec_helper.rb:13:in `require'
        from /Users/moonglum/Code/ashikawa-core/spec/unit/spec_helper.rb:13
        from /Users/moonglum/Code/ashikawa-core/spec/unit/collection_spec.rb:1:in `require'
        from /Users/moonglum/Code/ashikawa-core/spec/unit/collection_spec.rb:1
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:22:in `run'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:80:in `run'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:17:in `autorun'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bin/rspec:23
rake aborted!
/Users/moonglum/.rvm/rubies/ruby-1.8.7-p370/bin/ruby -S rspec spec/unit/collection_spec.rb spec/unit/connection_spec.rb spec/unit/cursor_spec.rb spec/unit/database_spec.rb spec/unit/document_spec.rb spec/unit/exception_spec.rb spec/unit/figure_spec.rb spec/unit/index_spec.rb spec/unit/query_spec.rb spec/unit/status_spec.rb failed
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:156:in `run_task'
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:124:in `initialize'
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:122:in `send'
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:122:in `initialize'
@bblimke
Owner
bblimke commented Feb 20, 2013

Sorry. Try now :)

@moonglum

Looks like nothing changed? But bundle definitely did update ;)

/Users/moonglum/.rvm/rubies/ruby-1.8.7-p370/bin/ruby -S rspec spec/unit/collection_spec.rb spec/unit/connection_spec.rb spec/unit/cursor_spec.rb spec/unit/database_spec.rb spec/unit/document_spec.rb spec/unit/exception_spec.rb spec/unit/figure_spec.rb spec/unit/index_spec.rb spec/unit/query_spec.rb spec/unit/status_spec.rb
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock/util/hash_counter.rb:1:in `require': no such file to load -- mutex (LoadError)
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock/util/hash_counter.rb:1
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock.rb:14:in `require'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock.rb:14
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock/rspec.rb:1:in `require'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bundler/gems/webmock-ebfb4a60f65a/lib/webmock/rspec.rb:1
        from /Users/moonglum/Code/ashikawa-core/spec/unit/spec_helper.rb:13:in `require'
        from /Users/moonglum/Code/ashikawa-core/spec/unit/spec_helper.rb:13
        from /Users/moonglum/Code/ashikawa-core/spec/unit/collection_spec.rb:1:in `require'
        from /Users/moonglum/Code/ashikawa-core/spec/unit/collection_spec.rb:1
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `each'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/configuration.rb:789:in `load_spec_files'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:22:in `run'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:80:in `run'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:17:in `autorun'
        from /Users/moonglum/.rvm/gems/ruby-1.8.7-p370/bin/rspec:23
rake aborted!
/Users/moonglum/.rvm/rubies/ruby-1.8.7-p370/bin/ruby -S rspec spec/unit/collection_spec.rb spec/unit/connection_spec.rb spec/unit/cursor_spec.rb spec/unit/database_spec.rb spec/unit/document_spec.rb spec/unit/exception_spec.rb spec/unit/figure_spec.rb spec/unit/index_spec.rb spec/unit/query_spec.rb spec/unit/status_spec.rb failed
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:156:in `run_task'
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:124:in `initialize'
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:122:in `send'
/Users/moonglum/.rvm/gems/ruby-1.8.7-p370/gems/rspec-core-2.12.2/lib/rspec/core/rake_task.rb:122:in `initialize'
Tasks: TOP => ci => spec:unit
(See full trace by running task with --trace)
@bblimke
Owner
bblimke commented Feb 20, 2013

Try chainging the revision in Gemfile manually to the latests on 4639363

@moonglum

Yep, now it works :+1:
Thanks for your help. Will it be in the next bugfix release?

@moonglum moonglum closed this Feb 20, 2013
@bblimke
Owner
bblimke commented Feb 20, 2013

Sure, please upgrade to just released 1.9.3

@moonglum

Works like a charm! Thank you :)

@moonglum

By the way: Thanks for webmock in general :) It's a great tool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.