Skip to content

Commit d1acb3d

Browse files
committed
Spring
1 parent 4a31fb1 commit d1acb3d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/ruby_lsp/ruby_lsp_rails/runner_client.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ def initialize
4141
# Spring needs a Process session ID. It uses this ID to "attach" itself to the parent process, so that when the
4242
# parent ends, the spring process ends as well. If this is not set, Spring will throw an error while trying to
4343
# set its own session ID
44-
begin
45-
Process.setpgrp
46-
Process.setsid
47-
rescue Errno::EPERM
48-
# If we can't set the session ID, continue
44+
if defined?(Spring)
45+
begin
46+
Process.setpgrp
47+
Process.setsid
48+
rescue Errno::EPERM
49+
# If we can't set the session ID, continue
50+
end
4951
end
5052

5153
stdin, stdout, stderr, wait_thread = Open3.popen3(

0 commit comments

Comments
 (0)