Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot step into require method in Ruby 3.0.0 #788

Open
JunichiIto opened this issue Feb 2, 2021 · 0 comments
Open

Cannot step into require method in Ruby 3.0.0 #788

JunichiIto opened this issue Feb 2, 2021 · 0 comments

Comments

@JunichiIto
Copy link

Problem description

I cannot step into require method in Ruby 3.0.0.

Here is a sample script.

require 'byebug/version'

puts RUBY_DESCRIPTION
puts Byebug::VERSION

Expected behavior

Run the script above in Ruby 2.7.2:

$ ruby sample.rb 
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
11.1.3

And I can step into require method:

$ byebug sample.rb

[1, 5] in /Users/jnito/Desktop/sample.rb
=> 1: require 'byebug/version'
   2: 
   3: puts RUBY_DESCRIPTION
   4: puts Byebug::VERSION
(byebug) s

[30, 39] in /Users/jnito/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb
   30:   #
   31:   # The normal <tt>require</tt> functionality of returning false if
   32:   # that file has already been loaded is preserved.
   33: 
   34:   def require(path)
=> 35:     if RUBYGEMS_ACTIVATION_MONITOR.respond_to?(:mon_owned?)
   36:       monitor_owned = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
   37:     end
   38:     RUBYGEMS_ACTIVATION_MONITOR.enter
   39: 
(byebug) s

[31, 40] in /Users/jnito/.rbenv/versions/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb
   31:   # The normal <tt>require</tt> functionality of returning false if
   32:   # that file has already been loaded is preserved.
   33: 
   34:   def require(path)
   35:     if RUBYGEMS_ACTIVATION_MONITOR.respond_to?(:mon_owned?)
=> 36:       monitor_owned = RUBYGEMS_ACTIVATION_MONITOR.mon_owned?
   37:     end
   38:     RUBYGEMS_ACTIVATION_MONITOR.enter
   39: 
   40:     path = path.to_path if path.respond_to? :to_path
(byebug) 

Actual behavior

Run the script above in Ruby 3.0.0:

$ ruby sample.rb 
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
11.1.3

This is okay, but I cannot step into require method:

$ byebug sample.rb 

[1, 5] in /Users/jnito/Desktop/sample.rb
=> 1: require 'byebug/version'
   2: 
   3: puts RUBY_DESCRIPTION
   4: puts Byebug::VERSION
(byebug) s
*** No sourcefile available for <internal:/Users/jnito/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>
(byebug) s
*** No sourcefile available for <internal:/Users/jnito/.rbenv/versions/3.0.0/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>
(byebug) 

Shouldn't it show this code?

Steps to reproduce the problem

(I described above.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant