Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

GC.enable

() -> bool
GC.enable → true or false

Enables garbage collection; returns whether garbage collection was disabled:

Example
GC.disable
GC.enable # => true
GC.enable # => false