【发布时间】:2022-01-23 08:37:18
【问题描述】:
我正在使用 ruby 2.5.5,我正在像这样启动服务器:
RAILS_MASTER_KEY=[MY_KEY] RAILS_ENV=staging MY_DATABASE_PASSWORD=[MY_PW] bin/rails server -b 0.0.0.0
这行得通,现在我想像这样生成迁移:
RAILS_MASTER_KEY=[MY_KEY] RAILS_ENV=staging MY_DATABASE_PASSWORD=[MY_PW] bin/rails generate migration CreateJoinTableMyTable column1 foreignKey
我收到以下错误:
/path/to/.rvm/gems/ruby-2.5.5/gems/activesupport-5.2.3/lib/active_support/encrypted_file.rb:96:in `handle_missing_key': Missing encryption key to decrypt file with. Ask your team for your master key and write it to /Users/BaxterStockman/empiric/hyperion-backend-webapp/config/master.key or put it in the ENV['RAILS_MASTER_KEY']. (ActiveSupport::EncryptedFile::MissingKeyError)
我还将RAILS_MASTER_KEY 写入~/.bashrc 并重新加载配置文件,但没有任何作用。
有人知道为什么会抛出这个错误吗?
【问题讨论】:
标签: ruby-on-rails ruby