为什么我收到AppFog Rails错误310:暂存失败:暂存任务失败?

时间:2013-04-01 22:10:00

标签: ruby-on-rails ruby appfog

我正在尝试将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

== UPDATE == 变     config.server_static_assets = false 到

config.server_static_assets = true

并预编译我的资产?

bundle exec rake assets:precompile

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

更改

gem 'jquery-rails'

gem 'cloudfoundry-jquery-rails'

仍然没有成功

2 个答案:

答案 0 :(得分:0)

您是否更改了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

答案 1 :(得分:0)

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

我做了目录的差异,但所有差异只是日志文件,应用程序名称和自述文件。没有什么能够成为错误的可能原因。