如何使用figaro gem将数组环境变量传递给heroku

如何使用figaro gem将数组环境变量传递给heroku,heroku,environment-variables,figaro-ruby,Heroku,Environment Variables,Figaro Ruby,我的application.yml文件如下: KEYS: ["xxxxxx", "yyyyyy", "zzzzzz"] 当我运行figaro heroku时:设置 我收到这个错误: .rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/figaro-1.1.1/lib/figaro/cli/heroku_set.rb:7:in `system': no implicit conversion of Integer into String (TypeErr

我的
application.yml
文件如下:

KEYS: ["xxxxxx", "yyyyyy", "zzzzzz"]
当我运行figaro heroku时:设置

我收到这个错误:

.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/figaro-1.1.1/lib/figaro/cli/heroku_set.rb:7:in `system': no implicit conversion of Integer into String (TypeError)

有人知道我应该如何在
application.yml
中格式化数组吗?

Heroku只允许使用普通字符串作为环境变量。如果您仍然希望传递数组,则需要将其连接到字符串中,然后在代码中拆分

# application.yml
KEYS: "xxxxxx,yyyyyy,zzzzzz"
然后在应用程序代码中,您可以像

(ENV["KEYS"] || "").split(",")