【问题标题】:Why do I get an AppFog Rails Error 310: Staging failed: Staging task failed?为什么我会收到 AppFog Rails 错误 310:暂存失败:暂存任务失败?
【发布时间】:2013-04-01 22:10:00
【问题描述】:

我正在尝试将 Rails 应用程序推送到 AppFog,但一直收到 301 错误。

它进入了 Staging,因此它显示在我的 AppFog 帐户中,但拒绝激活。尝试更新成功,但有同样的问题,它不会激活,只显示 404 错误。

这是消息文本:

$ af push RubyMongoGranny --runtime=ruby193
Would you like to deploy from the current directory? [Yn]: 
Pushing application 'RubyMongoGranny'...
Creating Application: OK
Binding Service [ruby_mongo_granny]: OK
Uploading Application:
  Checking for available resources: OK
  Processing resources: OK
  Packing application: OK
  Uploading (236K): OK   
Push Status: OK
Staging Application 'RubyMongoGranny': ..........Error 310: Staging failed: 'Staging task failed:
 Staging plugin failed: /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/gemfile_task.rb:325:in `log_and_raise_error': Error resolving Gemfile: Error parsing Gemfile: /tmp/d20130401-19438-h0d0st/Gemfile not found (RuntimeError)
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/gemfile_task.rb:50:in `specs'
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/gemfile_task.rb:103:in `gem_info'
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/gemfile_support.rb:86:in `gem_info'
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/rails3/plugin.rb:188:in `rails_version'
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/rails3/plugin.rb:199:in `precompile_assets'
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/rails3/plugin.rb:85:in `block in stage_application'
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/rails3/plugin.rb:76:in `chdir'
from /opt/cloudfoundry/vcap/staging/lib/vcap/staging/plugin/rails3/plugin.rb:76:in `stage_application'
from /opt/cloudfoundry/vcap/stager/bin/run_plugin:19:in `<main>'

我的 gemfile 看起来像:

source 'https://rubygems.org'

gem 'rails'
gem 'mongo_mapper'
gem 'bson_ext'


group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'


  gem 'uglifier', '>= 1.0.3'
end

gem 'cloudfoundry-jquery-rails

==更新== 改变了 config.server_static_assets = false 到

config.server_static_assets = true

并预编译了我的资产?

bundle exec rake assets:precompile

但它仍然给我同样的错误。

改变了

gem 'jquery-rails'

gem 'cloudfoundry-jquery-rails'

还是没有成功

【问题讨论】:

    标签: ruby-on-rails ruby appfog


    【解决方案1】:

    你的config/environments/production.rb改了吗

    config.server_static_assets = false
    

    config.server_static_assets = true
    

    并预编译您的资产?

    bundle exec rake assets:precompile
    

    此外,对于 Ruby 1.9,AppFog 需要对 jquery-rails gem 进行调整。删除或注释掉gem 'jquery-rails' 并添加gem 'cloudfoundry-jquery-rails',如下所示:

    # gem 'jquery-rails'
    gem 'cloudfoundry-jquery-rails'
    

    更多文档here

    【讨论】:

    • 那没有做到。我通读了文档。我想知道是否应该在我的 Gemfile 中包含一个 cloudfoundry gem,但文档没有提到类似的内容。
    • 如果您使用的是 Ruby 1.9,您应该包含 gem 'cloudfoundry-jquery-rails' 并删除 gem 'jquery-rails'
    【解决方案2】:

    对于这个问题并没有真正想出一个好的解决方案。但是,我创建了一个全新的 rails 应用程序,并将我的所有文件从旧的移动到新的。现在它将推送到 AppFog。

    我对目录做了一个差异,但所有差异都只是日志文件、应用程序名称和自述文件。没有什么是真正突出的可能导致错误的原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-10
      • 1970-01-01
      • 1970-01-01
      • 2016-05-30
      • 1970-01-01
      • 1970-01-01
      • 2022-07-21
      • 2021-12-26
      相关资源
      最近更新 更多