Skip to content

Commit

Permalink
Puma::Launcher: avoid a leading space character in RUBYOPT (#1455)
Browse files Browse the repository at this point in the history
The problem is this:

```
2.4.2 :001 > [nil, 'foo'].join(' ')
 => " foo"
```

Note the leading space character. By `lstrip`:ing the result of the join, we avoid this altogether.

(This is a fix for the underlying problem that triggered jruby/jruby#4849.)
  • Loading branch information
perlun authored and nateberkopec committed Nov 16, 2017
1 parent 42b74d4 commit ac7106e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puma/launcher.rb
Expand Up @@ -168,7 +168,7 @@ def run
env = Bundler::ORIGINAL_ENV.dup
# add -rbundler/setup so we load from Gemfile when restarting
bundle = "-rbundler/setup"
env["RUBYOPT"] = [env["RUBYOPT"], bundle].join(" ") unless env["RUBYOPT"].to_s.include?(bundle)
env["RUBYOPT"] = [env["RUBYOPT"], bundle].join(" ").lstrip unless env["RUBYOPT"].to_s.include?(bundle)
env
else
ENV.to_h
Expand Down

0 comments on commit ac7106e

Please sign in to comment.