Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 检测到Heroku上的Rails配置后出错_Ruby On Rails_Heroku_Deployment - Fatal编程技术网

Ruby on rails 检测到Heroku上的Rails配置后出错

Ruby on rails 检测到Heroku上的Rails配置后出错,ruby-on-rails,heroku,deployment,Ruby On Rails,Heroku,Deployment,我的rails应用程序在本地运行,但在部署到Heroku时遇到了问题。看起来预编译很好,但我在这里得到了一堆错误: remote:----->检测rake任务 远程:-->为Rails资产管道准备应用程序 远程:运行:rake资产:预编译 远程:系统中未检测到可执行文件。 远程:下载纱线在https://yarnpkg.com/en/docs/install 远程:已完成资产预编译(1.79s) 远程:清理资产 远程:运行:rake资产:清理 远程:-->检测rails配置 远程:$rails

我的rails应用程序在本地运行,但在部署到Heroku时遇到了问题。看起来预编译很好,但我在这里得到了一堆错误:

remote:----->检测rake任务
远程:-->为Rails资产管道准备应用程序
远程:运行:rake资产:预编译
远程:系统中未检测到可执行文件。
远程:下载纱线在https://yarnpkg.com/en/docs/install
远程:已完成资产预编译(1.79s)
远程:清理资产
远程:运行:rake资产:清理
远程:-->检测rails配置
远程:$rails runner“begin;put%Q{heroku.detecting.config.for.assets.compile={rails.application.config.try(:assets).try(:compile)};rescue=>e;put e;put e.backtrace;end;begin;put%Q{heroku.detecting.config.for.action\u dispatch.x\u发送文件头={rails.application.config.try(:action\u dispatch)。try(:x\u发送文件头)};rescue=>e;puts e;puts e.backtrace;end;begin;puts%Q{heroku.detecting.config.for.active_storage.service={Rails.application.config.try(:active_storage).try(:service)};rescue=>e;puts e;puts e.backtrace;end;”
远程:/tmp/build_e5c8ea775fe1792a905edb1b8e4870ab/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.1/lib/active_-support/message_-encryptor.rb:206:“解救在解密中”:activesupport::MessageEncryptor::InvalidMessage(activesupport::MessageEncryptor::InvalidMessage)
远程:从/tmp/build_e5c8ea775fe1792a905edb1b8e4870ab/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.1/lib/active_support/message_encryptor.rb:183:in`_decrypt'

远程:从/tmp/build_e5c8ea775fe1792a905edb1b8e4870ab/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.1/lib/active_support/message_encryptor.rb:157:在“decrypt_and_verify”中
错误是由于Heroku缺少用于解密凭证文件的主密钥。创建一个
RAILS\u MASTER\u KEY
ENV变量,RAILS将自动检测该变量,并将其用作解密的主密钥

对于heroku:
$heroku config:set RAILS\u MASTER\u KEY=


这是了解rails凭据API如何工作的一个好方法

在将rails部署到Heroku时,您遵循什么指南?是的。我在配置变量中使用了SECRET\u BASE\u密钥而不是RAILS\u MASTER\u密钥。谢谢