我正在尝试在Cloud Foundry中托管一个示例(HelloWorld)Play应用,但我总是在Staging中收到此错误,
Error 310: Staging failed: 'Staging task failed:
Staging plugin failed: cp: cannot stat `/var/vcap/data/stager/tmp/d20120828-24156-128z05h/unstaged/logs/*': No such file or directory
/var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:1231:in `chmod': No such file or directory - /var/vcap/data/stager/tmp/d20120828-24156-128z05h/staged/app/start (Errno::ENOENT)
from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:1231:in `chmod'
from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:879:in `block in chmod'
from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:878:in `each'
from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:878:in `chmod'
from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:14:in `block in stage_application'
from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:11:in `chdir'
from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:11:in `stage_application'
from /var/vcap/packages/stager/bin/run_plugin:19:in `<main>'
我对此很新,所以不知道它意味着什么。我也尝试使用谷歌搜索但无济于事。
我也尝试了这个,但它不起作用SO Question similar to this one
修改
上面的链接指向工作,只需确保在vmc push命令中提供应用程序名称
如答案所示。
任何帮助都非常感激。
感谢。
开发环境:
Play 2.0 - 基于Scala
Ubuntu 12.04
vmc以部署应用程序。
其他信息:
我遵循了本教程Play scala Cloud Foundry
Would you like to deploy from the current directory? [Yn]:
Application Name: HelloSample
Detected a Standalone Application, is this correct? [Yn]: n
1: Play
2: Lift
3: JavaWeb
4: Node
5: Standalone
6: Rails
7: Spring
8: Rack
9: Grails
10: Sinatra
Select Application Type: 1
Selected Play Framework Application
Application Deployed URL [HelloSample.cloudfoundry.com]: hellosample.cloudfoundry.com
Memory reservation (128M, 256M, 512M, 1G, 2G) [256M]:
How many instances? [1]:
1
Create services to bind to 'HelloSample'? [yN]: 1
Would you like to save this configuration? [yN]: y
Manifest written to manifest.yml.
Creating Application: OK
Uploading Application:
Checking for available resources: OK
Processing resources: OK
Packing application: OK
Uploading (106K): OK
Push Status: OK
Staging Application 'HelloSample': ..Error 310: Staging failed: 'Staging task failed:
Staging plugin failed: cp: cannot stat `/var/vcap/data/stager/tmp/d20120828-24156-128z05h/unstaged/logs/*': No such file or directory
/var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:1231:in `chmod': No such file or directory - /var/vcap/data/stager/tmp/d20120828-24156-128z05h/staged/app/start (Errno::ENOENT)
from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:1231:in `chmod'
from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:879:in `block in chmod'
from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:878:in `each'
from /var/vcap/data/packages/ruby/6.1/lib/ruby/1.9.1/fileutils.rb:878:in `chmod'
from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:14:in `block in stage_application'
from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:11:in `chdir'
from /var/vcap/packages/stager/vendor/bundle/ruby/1.9.1/gems/vcap_staging-0.1.62/lib/vcap/staging/plugin/play/plugin.rb:11:in `stage_application'
from /var/vcap/packages/stager/bin/run_plugin:19:in `<main>'
'
答案 0 :(得分:1)
你需要在Play中运行“dist”命令。这会在./dist文件夹中生成一个zip文件,您可以像这样使用'path'开关推送应用程序;
vmc push <app-name-goes-here> --path=dist/<generated-zip-file>.zip
VMC应将此识别为Play应用程序并正确部署。