heroku - Play 1.2.5 应用部署在 heroku "Oops. conf/routes or conf/application.conf missing."

标签 heroku playframework

我有一个 play 1.2.5 应用程序,想将它部署到某个地方(这样我就可以为一些 OAuth 回调注册它)。我正在尝试将其推送到 heroku,但出现以下错误

-----> Play! app detected
-----> Installing OpenJDK 1.6...done
-----> WARNING: Play! version not specified in dependencies.yml. Default version: 1.2.4 being used....
-----> Installing Play! 1.2.4.....
-----> done
-----> Installing ivysettings.xml..... done
-----> Building Play! application...
       ~        _            _ 
       ~  _ __ | | __ _ _  _| |
       ~ | '_ \| |/ _' | || |_|
       ~ |  __/|_|\____|\__ (_)
       ~ |_|            |__/   
       ~
       ~ play! 1.2.4, http://www.playframework.org
       ~
       1.2.4
       Building Play! application at directory ./
       Resolving dependencies: .play/play dependencies ./ --forProd --forceCopy --silent -Duser.home=/tmp/build_ev7rk9y0hage 2>&1
       ~ !! /tmp/build_ev7rk9y0hage/conf/dependencies.yml does not exist
       ~
       ~ Done!
       ~
       Precompiling: .play/play precompile ./ --silent 2>&1
       ~ Oops. conf/routes or conf/application.conf missing.
       ~ /tmp/build_ev7rk9y0hage does not seem to host a valid application.
       ~
 !     Failed to build Play! application
 !     Cleared Play! framework from cache

 !     Push rejected, failed to compile Play! app

我一直在遵循这个指南: https://devcenter.heroku.com/articles/play 更具体地说;

  1. heroku 登录
  2. 设置应用程序依赖项以 Play 1.2.5
  3. 设置.gitignore 文件
  4. 使用 web: play run --http.port=$PORT $PLAY_OPTS 在项目根文件夹中创建 Procfile
  5. 致力于本地 git 仓库
  6. heroku 创建
  7. git push heroku master

我不知道如何解决这个问题,stackoverflow 和 googlegroups(以及其他一些来源)都没有帮助。

最佳答案

所以我解决了这个问题,问题是我们已经在使用 git 并且存储库已在 Play 项目 parent/projRoot/ 的父文件夹中初始化,所以我猜 heroku 正在寻找文件在错误的地方,因此无法构建。使用在 projRoot/ 中初始化的新 git 存储库,一切正常。

更新 要从子文件夹部署 Play 应用程序,我找到了这些解决方案:

Deploy Play app on Heroku from a subdirectory of git repo

https://groups.google.com/forum/?fromgroups#!topic/play-framework/Gk9nfNSUzQs

关于heroku - Play 1.2.5 应用部署在 heroku "Oops. conf/routes or conf/application.conf missing.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17148784/

相关文章:

ruby-on-rails - Heroku 上的 Ruby 地理编码器生成私有(private) IP 地址

git - 多个存储库和 Heroku

javascript - 传递 null 值时 Heroku 应用程序崩溃

java - 斯卡拉.MatchError : null for all requests after some timepoint

Scala Play 框架使用 Play WS 将多个信任管理器指向 PEM 文件

mysql - Play framework 2.2.2 evolutions 未在 mysql 中触发

scala - 为什么 Play 的 PushEnumerator 需要在迭代器完成之前关闭()?

javascript - Heroku 上的 Angular 应用程序部署问题

java - 测试可选字段值的正确方法

postgresql - 为什么我得到 ActionView::Template::Error: undefined method `name' for nil:NilClass on Heroku 而不是本地