You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I find a bug that the rbs prototype runtime Object command fails on Ruby 3.0 (it succeeds on Ruby 2.7).
Please see the reproduction below for details.
Reproduction
Note: I'm using Docker to reduce any environment-specific problems.
Ruby 3.0
rbs prototype runtime Object fails with LoadError:
$ docker run --rm -it rubylang/ruby:3.0.0-focal bash
# gem install rbs:1.0.4Fetching rbs-1.0.4.gemSuccessfully installed rbs-1.0.41 gem installed
# rbs prototype runtime Object/usr/local/lib/ruby/3.0.0/set/sorted_set.rb:4:in `rescue in <top (required)>': The `SortedSet` class has been extracted from the `set` library.You must use the `sorted_set` gem or other alternatives. (RuntimeError) from /usr/local/lib/ruby/3.0.0/set/sorted_set.rb:1:in `<top (required)>' from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:305:in `const_get' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:305:in `block in generate_constants' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:304:in `each' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:304:in `generate_constants' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:385:in `generate_class' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:45:in `block in decls' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:42:in `each' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:42:in `decls' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/cli.rb:597:in `run_prototype' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/cli.rb:113:in `run' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/exe/rbs:7:in `<top (required)>' from /usr/local/bin/rbs:23:in `load' from /usr/local/bin/rbs:23:in `<main>'<internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- sorted_set (LoadError) from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from /usr/local/lib/ruby/3.0.0/set/sorted_set.rb:2:in `<top (required)>' from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from <internal:/usr/local/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:305:in `const_get' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:305:in `block in generate_constants' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:304:in `each' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:304:in `generate_constants' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:385:in `generate_class' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:45:in `block in decls' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:42:in `each' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/prototype/runtime.rb:42:in `decls' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/cli.rb:597:in `run_prototype' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/lib/rbs/cli.rb:113:in `run' from /usr/local/lib/ruby/gems/3.0.0/gems/rbs-1.0.4/exe/rbs:7:in `<top (required)>' from /usr/local/bin/rbs:23:in `load' from /usr/local/bin/rbs:23:in `<main>'
The text was updated successfully, but these errors were encountered:
ybiquitous
changed the title
[prototype runtime] fails due to cannot load such file -- sorted_set
[prototype runtime] fails due to cannot load such file -- sorted_set with Ruby 3.0
Feb 9, 2021
I got similar errors when I used prototype runtime for Rails gems, because they use autoload. If the error is suppressed, the errors for Rails gems will be also resolved.
@pocke Thank you for sharing it! I understand the cause.
It seems a bit weird to me that Object.constants includes SortedSet despite the sorted_set gem is not loaded... 🤔
But I cannot get any good idea to resolve this error. 😓
Hello, I find a bug that the
rbs prototype runtime Object
command fails on Ruby 3.0 (it succeeds on Ruby 2.7).Please see the reproduction below for details.
Reproduction
Note: I'm using Docker to reduce any environment-specific problems.
Ruby 3.0
rbs prototype runtime Object
fails withLoadError
:Ruby 2.7
rbs prototype runtime Object
has no problems:Environment
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
rbs 1.0.4
The text was updated successfully, but these errors were encountered: