【问题标题】:git push heroku master is rejected and faild to compile ruby appgit push heroku master 被拒绝,无法编译 ruby​​ 应用程序
【发布时间】:2017-01-17 23:46:14
【问题描述】:

做了一些研究,但当我尝试git push heroku master. 时无法弄清楚是什么导致了拒绝

这是我的 git 仓库:https://github.com/leonahu/IMGfeed 这是拒绝的详细信息:

remote:        Tasks: TOP => environment
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to feedimg.
remote: 

【问题讨论】:

  • config.assets.initialize_on_precompile = false - 你添加到config/application.rb了吗?
  • @dkp。其实我有。

标签: ruby-on-rails git heroku paperclip


【解决方案1】:

我尝试了上述所有建议,但它在我的应用程序上不起作用(感谢所有尝试提供帮助的人。) 最终为我工作的是我基本上通过运行来强迫 Heroku:

git push heroku master --force

在那之后,我又可以git push heroku master了。

【讨论】:

    【解决方案2】:

    我认为您可能忘记在生产环境中设置 config.secret_key_base。运行:

    heroku config:set SECRET_KEY_BASE=your_secret_key_base
    

    要获取新的密钥,您可以在项目的根文件夹中运行 bundle exec rake secret

    【讨论】:

      【解决方案3】:

      错误提示资产无法预编译,因此您应该通过运行 bundle exec rake assets:precompile 来预编译它们

      或专门用于生产运行RAILS_ENV=production bundle exec rake assets:precompile

      确保您的config/application.rb 文件中有这行代码:config.assets.initialize_on_precompile = false

      之后,尝试再次推送到heroku

      【讨论】:

      • 谢谢@luka kerr。我已经完成了你提到的所有步骤,但它仍然产生同样的错误。
      • 这是您遇到的唯一错误吗?如果错误更长,您能否编辑您的问题并发布完整的错误日志
      • 哦,我刚刚在 github 上查看了您的应用程序,发现您使用 sqlite 3 作为您的数据库 - 在 heroku 上,这不受支持。您需要将数据库更改为 postgres 或其他内容。您可以在此处获取更多详细信息 devcenter.heroku.com/articles/sqlite3
      猜你喜欢
      • 2014-06-07
      • 2013-03-22
      • 2019-10-25
      • 2013-05-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-24
      • 2012-12-29
      • 2017-04-27
      相关资源
      最近更新 更多