【问题标题】:unable to deploy rails 4 app to heroku无法将 Rails 4 应用程序部署到 Heroku
【发布时间】:2014-07-16 20:49:14
【问题描述】:

当我尝试将我的应用部署到 heroku 时,我收到以下响应

我有一个带有'web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb' 的 Procfile 我正在使用独角兽

hangman git:(master) ✗ git push heroku master
Initializing repository, done.
Counting objects: 252, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (168/168), done.
Writing objects: 100% (252/252), 375.50 KiB | 0 bytes/s, done.
Total 252 (delta 73), reused 217 (delta 53)


 Push rejected, no Cedar-supported app detected

To git@heroku.com:calm-taiga-4375.git
[remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:calm-taiga-4375.git'

【问题讨论】:

  • 我查看了建议的链接,但它们都无法解决我的问题。这就是我发布它的原因
  • heroku logs 的日志显示了什么?你确实有GemfileGemfile.lock,对吗?您使用的是自定义 buildpack 吗?
  • 对我来说no app detected 意味着您没有提交rails项目中的所有文件。

标签: ruby-on-rails ruby git heroku github


【解决方案1】:

构建包

当您部署到 Heroku 时,它使用名为 buildpacks 的东西来确定您正在使用的应用程序类型

buildpacks 基本上通过查看您的git 存储库(使用pre-receive 挂钩),识别将确定应用程序类型的某些文件,然后部署到您的系统来工作。

您的错误向我表明 Heroku buildpack 无法识别您的应用,因此它抛出了您的错误。


Git

正如 cmets 中所建议的,这可以通过确保您的 .gitignore 文件没有添加很多不相关的文件并确保您的 Procfile 和其他文件之类的文件是安全的来解决


修复

  1. 确保您的应用没有非常规文件
  2. 确保您没有在config/config.rbconfig/environment.rbconfig/application.rb 中添加任何内容

我会亲自删除不属于 Rails 应用程序的任何东西(如Procfile 等),以使其正常工作。工作后,您可以一次添加一件事,然后再找到导致问题的一件事

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-25
    • 1970-01-01
    • 1970-01-01
    • 2015-10-25
    相关资源
    最近更新 更多