DEV: Compatibility with TruffleRuby (#16641)

This commit is contained in:
Gerhard Schlager
2022-05-05 03:50:02 +02:00
committed by GitHub
parent 80d2888222
commit 8442a07c13
3 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
if !ENV["RAILS_ENV"] && (ARGV[0] == "s" || ARGV[0] == "server")
if !ENV["RAILS_ENV"] && (ARGV[0] == "s" || ARGV[0] == "server") && Process.respond_to?(:fork)
ENV["UNICORN_PORT"] ||= "3000"
if ARGV[1] == "-p" && (port = ARGV[2].to_i) > 0