Issue #13180 has been updated by Adam Shannon.


Thanks for the quick patches. Would those likely be released in upcoming bug fixes? I can keep using my forked versions and reinstall once releases are out. 

----------------------------------------
Bug #13180: 'superclass mismatch for class' on nested classes 
https://bugs.ruby-lang.org/issues/13180#change-62829

* Author: Adam Shannon
* Status: Third Party's Issue
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin15]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
I've been seeing the following errors when attempting to run different ruby projects. 

~~~
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/digest.rb:57:in `<class:Digest>': superclass mismatch for class Digest (TypeError)
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/digest.rb:16:in `<module:OpenSSL>'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/digest.rb:15:in `<top (required)>'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl.rb:19:in `require'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl.rb:19:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis/connection/ruby.rb:8:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis/connection/ruby.rb:8:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis/connection.rb:9:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis/connection.rb:9:in `<top (required)>'
	from /usr/local/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:2775:in `require'
	from /usr/local/lib/ruby/gems/2.4.0/gems/redis-3.3.3/lib/redis.rb:2775:in `<top (required)>'
	from /Users/adam/src/banno/banno-utility-belt/lib/sneakily_grant_auth.rb:2:in `require'
	from /Users/adam/src/banno/banno-utility-belt/lib/sneakily_grant_auth.rb:2:in `<top (required)>'
	from /Users/adam/src/banno/banno-utility-belt/libexec/bub-api.rb:2:in `require'
	from /Users/adam/src/banno/banno-utility-belt/libexec/bub-api.rb:2:in `<top (required)>'
	from /Users/adam/bin/bub:19:in `load'
	from /Users/adam/bin/bub:19:in `block in <main>'
	from /Users/adam/bin/bub:19:in `each'
	from /Users/adam/bin/bub:19:in `<main>'
~~~

I get a similar error with the Cipher class also.

~~~
/usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:64:in `<class:Cipher>': superclass mismatch for class Cipher (TypeError)
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:16:in `<module:OpenSSL>'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl/cipher.rb:15:in `<top (required)>'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl.rb:17:in `require'
	from /usr/local/Cellar/ruby/2.4.0/lib/ruby/2.4.0/openssl.rb:17:in `<top (required)>'
~~~

I was able to get my programs to run by commenting out line 57 in digest.rb and line 64 in cipher.rb. For reference, the lines were: 

~~~
cipher.rb:  class Cipher < Cipher; end
digest.rb:  class Digest < Digest; end # :nodoc:
~~~

I tried for a few minutes to reproduce this with the following, but was unable to see the error. (Running the file through ruby produced no error.)

~~~
class Foo
  class Foo < Foo; end
end
~~~



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>