Play Framework 2.1.1部署问题 [英] Play Framework 2.1.1 Deployment Issues

查看:95
本文介绍了Play Framework 2.1.1部署问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我正在尝试部署我非常简单的Play Framework 2.1.1应用程序,但每当我通过端口命令行传递标志并应用数据库演变时,它们都会被忽略。

So, I'm trying to deploy my very simple Play Framework 2.1.1 app but whenever I pass flags through the command line for port and to apply database evolutions, they are ignored.

例如:


sudo play start -Dhttp.port = 80 -DapplyEvolutions.default = true

sudo play start -Dhttp.port=80 -DapplyEvolutions.default=true

使用此命令,服务器将无法启动。 port和applyEvolutions = true标志都被完全忽略并抛出此错误:

Using this command, the server will not start. Both the port and applyEvolutions=true flags are ignored completely and it throws this error:


[warn] play - 您的生产数据库[默认]需要进化!
[warn] play - 运行-DapplyEvolutions.default = true如果你想
自动运行它们(小心)
糟糕,无法启动服务器。 @ 6elhl9mca:数据库'默认'需要进化!

[warn] play - Your production database [default] needs evolutions! [warn] play - Run with -DapplyEvolutions.default=true if you want to run them automatically (be careful) Oops, cannot start the server. @6elhl9mca: Database 'default' needs evolution!

我已经尝试了所有我能想到的无济于事的东西。在我的本地机器上使用Play Run工作正常,没有问题。服务器正在运行Ubuntu 12.04。所有正确的驱动程序和连接字符串都存在并经过测试,数据库正在运行,除了Play框架外,一切正常运行。

I've tried everything I can think of to no avail. Using Play Run on my local machine works fine, no issues. The server is running Ubuntu 12.04. All the proper drivers and connection strings are present and tested, database is running, everything is working without issue except the Play Framework.

推荐答案

好的,所以我没有真正找到解决方案,但我找到了解决方法。这不是Play Framework 2.x文档中的任何地方(还是),所以我想我会把它放在这里以防其他人卡住:

Ok, so I didn't really find a solution for this, but I found a workaround. This isn't anywhere in the Play Framework 2.x documentation (yet), so I figure I'll put it here in case someone else gets stuck:

applyEvolutions.default = true 进入 application.conf DOES 工作,并将使数据库演变适用自动。命令行参数 -DapplyEvolutions.default = true 不会工作,因未知原因而被忽略。

Putting applyEvolutions.default=true into application.conf DOES work, and will make database evolutions apply automatically. The command line argument -DapplyEvolutions.default=true DOES NOT work and is ignored for reasons unknown.

http.port = 80 放入 application.conf 不会工作。命令行参数 -Dhttp.port = 80 不能用于设置要运行的端口号。

Putting http.port=80 into application.conf DOES NOT work. The command line argument -Dhttp.port=80 also DOES NOT work for setting the port number to run on.

因此,要设置端口号,请使用此命令:

So, to set the port number use this command instead:

播放start 80播放run 80(完全按照所示使用双引号)。

play "start 80" or play "run 80" (use double quotes exactly as shown).

出于某种原因, port命令与双引号完全相同,正确设置要运行的端口号。

For some reason when the port command is written exactly as above in double quotes, the port number to run on is set properly.

这在任何地方的框架文档中都找不到。我创建了另一个拉取请求来添加它,但我为此框架解决的最后一个问题(数据库加密)被拒绝为仅限于有限的利基用例,因此文档更新被拒绝。无论如何,我仍然可以尝试。

This is not found in the framework documentation anywhere. I'd create another pull request to add it, but the last issue I solved for this framework (database encryption) was denigrated as being a "limited, niche use case" only and the documentation update was thus denied. I may still try anyway.

希望这有助于某人。

这篇关于Play Framework 2.1.1部署问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆