3

My application.yml file is as follows:

KEYS: ["xxxxxx", "yyyyyy", "zzzzzz"]

When I run figaro heroku:set

I receive this error:

.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)

Anyone know how I should format arrays in application.yml?

wuliwong
  • 4,238
  • 9
  • 41
  • 69

1 Answers1

5

Heroku only allows plain strings as environmental variables. If you still want to pass an array, you need to join it into string and then split in your code.

# application.yml
KEYS: "xxxxxx,yyyyyy,zzzzzz"

And then in your application code you can use it like

(ENV["KEYS"] || "").split(",") 
Michał Młoźniak
  • 5,466
  • 2
  • 22
  • 38