在一行中包含特定于环境的 conf 文件

Include an environment specific conf file with one line

所以我试图在 application.conf 文件中这样做:

include environments/${server_env}.conf

但显然它不起作用,因为我读到 "include should be followed by a non-quoted sequence of chars"。任何想法如何做到这一点?

是的,documentation对此非常具体:

Value concatenation is NOT performed on the "argument" to include or url() etc. The argument must be a single quoted string. No substitutions are allowed, and the argument may not be an unquoted string or any other kind of value.

另请参阅 this 了解一些替代方法。