有人知道如何在production.rb
使用 new时设置 ENV 变量secrets.yml
吗?
我得到key: wrong number of arguments (0 for 1)
以下内容:
生产.rb:
# DOES NOT WORK
ENV["SOME_STUFF_KEY"] = Rails.application.secrets.some_stuff.key
ENV["SOME_STUFF_SECRET_KEY"] = Rails.application.secrets.some_stuff.secret_key
# NOTE THAT THIS WORKS:
# ENV["SOME_STUFF_KEY"] = "abcdefg";
# ENV["SOME_STUFF_SECRET_KEY"] = "123456789123456789";
秘密.yml:
production:
some_stuff:
key: abcdefg
secret_key: 123456789123456789