Skip to content

Commit

Permalink
Remove resolved debugger caveat
Browse files Browse the repository at this point in the history
The issue has been resolved in ruby/debug#558
and has been released since version 1.5.0
  • Loading branch information
st0012 committed Jul 30, 2022
1 parent 2b3245d commit 757094c
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions guides/source/debugging_rails_applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,37 +752,6 @@ This technique can save you from repeated manual input and make the debugging ex

You can find more commands and configuration options from its [documentation](https://github.com/ruby/debug).

#### Autoloading Caveat

Debugging with `debug` works fine most of the time, but there's an edge case: If you evaluate an expression in the console that autoloads a namespace defined in a file, constants in that namespace won't be found.

For example, if the application has these two files:

```ruby
# hotel.rb
class Hotel
end

# hotel/pricing.rb
module Hotel::Pricing
end
```

and `Hotel` is not yet loaded, then

```
(rdbg) p Hotel::Pricing
```

will raise a `NameError`. In some cases, Ruby will be able to resolve an unintended constant in a different scope.

If you hit this, please restart your debugging session with eager loading enabled (`config.eager_load = true`).

Stepping commands line `next`, `continue`, etc., do not present this issue. Namespaces defined implicitly only by
subdirectories are not subject to this issue either.

See [ruby/debug#408](https://github.com/ruby/debug/issues/408) for details.

Debugging with the `web-console` gem
------------------------------------

Expand Down

0 comments on commit 757094c

Please sign in to comment.