RailsEnvCredentials 它增强了Rails v5.2.0引入的凭据功能。 安装 将此行添加到Rails应用程序的Gemfile中: group :development , :test do gem 'rails-env-credentials' end 然后执行: $ bundle 用法 RailsEnvCredentials通过以下方式管理凭据和密钥对: config/credentials-development.yml.enc config/credentials-test.yml.enc config/credentials.yml.enc master