Skip to content

Commit 85a5746

Browse files
committed
fix
1 parent 67400c9 commit 85a5746

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pyroscope_ffi/ruby/lib/pyroscope.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ module Utils
2222
attach_function :thread_id, [], :uint64
2323
end
2424

25-
class Engine < Rails::Engine
26-
config.after_initialize do
27-
next unless ::Pyroscope.current_config && ::Pyroscope.current_config.autoinstrument_rails
25+
if defined?(::Rails::Engine)
26+
class Engine < ::Rails::Engine
27+
config.after_initialize do
28+
next unless ::Pyroscope.current_config && ::Pyroscope.current_config.autoinstrument_rails
2829

29-
::Pyroscope.initialize_rails_hooks
30+
::Pyroscope.initialize_rails_hooks
31+
end
3032
end
3133
end
3234

0 commit comments

Comments
 (0)