Heroku '无法检测到 rake 任务' [英] Heroku 'Could not detect rake tasks'

查看:46
本文介绍了Heroku '无法检测到 rake 任务'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个部署到 Heroku 的遗留应用程序突然无法编译.它在本地运行良好,当我上次在 3/23 部署它时没有问题.现在我正在尝试进行一个小的更改 - 添加到视图的单个链接.

我知道此应用使用了不受支持的 Ruby/Rails/Spreecommerce 版本 - 1.9.3/3.0.20/0.60.我们有更新的计划,但同时我需要让这个改变生效.

来自 Heroku 的错误是:

远程:!无法检测到 rake 任务偏僻的:  !确保您可以对您的应用程序运行 `$ bundle exec rake -P`偏僻的:  !并使用您的 Gemfile 的生产组.

该 rake 任务在本地完成.我仔细检查了 Rakefile,但没有看到任何问题.它也在 4 年内更新,同时每月多次部署也没有问题.6 个月内也没有任何 Gemfile 更改,我已经确认该应用程序在本地运行.

这是我的 Gemfile(带有前一个开发人员的混淆个人存储库):

<代码>1 个来源 'http://rubygems.org'23 红宝石1.9.3"45 gem 'rails', '3.0.20'67 # 通用 gem 依赖优先8 宝石'耙','0.8.7'9 gem 'aws-s3', :require => 'aws/s3'10 宝石'dynamic_form'11 颗宝石heroku"12 gem 'memcache-client'13 gem 'net-sftp', '~> 2.0.5'14 gem 'net-ssh', '~> 2.0.9'15 颗宝石fastercsv"1617 # 其次是狂欢本身,然后是所有特定于狂欢的扩展18 颗宝石 'savon', '0.9.7'19 gem 'spree', '0.60.4', :git => 'git://github.com/[some_dev_personal_repo]/spree.git'20 gem 'spree_heroku', '1.0.0', :git => 'git://github.com/paxer/spree-heroku.git'21 gem 'spree_advanced_cart', :git => 'git://github.com/romul/spree_advanced_cart.git', :branch => '0-60-x'2223 gem 'rack-timeout'2425 # 开发/测试/阶段/生产宝石26 组 :production, :staging do27 宝石 'pg'28 #gem 'rails_12factor'29 结束3031组:开发,:测试32 宝石'sqlite3'33 宝石 'webrat'34颗宝石黄瓜导轨"35 gem 'rspec-rails'36 结束

这是我的 Rakefile(减去识别命名空间):

<预><代码>1 # 在 lib/tasks 中以 .rake 结尾的文件中添加您自己的任务,2 # 例如 lib/tasks/capistrano.rake,它们将自动对 Rake 可用.34 需要 File.expand_path('../config/application', __FILE__)5 需要'耙'67 [命名空间]::Application.load_tasks

解决方案

Heroku 的 Schneems 解决了这个问题.尽管从未指定过此应用程序的机架超时版本,但这就是问题的根源.

我相信在某些时候 Gemfile.lock 文件也是在 Windows 机器上生成的,这使得 Heroku 无法重用我的锁定文件(这在我之前 - 我只使用 OS X 进行过部署).

我指定了 gem 'rack-timeout', '0.3.2',运行 bundle install,然后发现部署成功了.

非常感谢 Schneems!

I have a legacy app deployed to Heroku that is suddenly failing to compile. It works fine locally, and had no problems when I last deployed it on 3/23. Now I'm trying to push a small change - a single link added to a view.

I know this app is using unsupported versions of Ruby / Rails / Spreecommerce - 1.9.3 / 3.0.20 / 0.60. We have plans to update, but in the meantime I need to get this change live.

The error from Heroku is:

remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.

That rake task completes locally. I double checked the Rakefile, but don't see any issues there. It also been updated in 4 years and hasn't been a problem for multiple deploys per month in the meantime. There also haven't been any Gemfile changes in 6 months and I've confirmed the app runs locally.

Here's my Gemfile (with an obfuscated personal repo of a previous dev):


  1 source 'http://rubygems.org'
  2
  3 ruby "1.9.3"
  4
  5 gem 'rails', '3.0.20'
  6
  7 # Generic gem dependencies first
  8 gem 'rake', '0.8.7'
  9 gem 'aws-s3', :require => 'aws/s3'
 10 gem 'dynamic_form'
 11 gem 'heroku'
 12 gem 'memcache-client'
 13 gem 'net-sftp', '~> 2.0.5'
 14 gem 'net-ssh', '~> 2.0.9'
 15 gem 'fastercsv'
 16
 17 # Followed by spree itself first, all spree-specific extensions second
 18 gem 'savon', '0.9.7'
 19 gem 'spree', '0.60.4', :git => 'git://github.com/[some_dev_personal_repo]/spree.git'
 20 gem 'spree_heroku', '1.0.0', :git => 'git://github.com/paxer/spree-heroku.git'
 21 gem 'spree_advanced_cart', :git => 'git://github.com/romul/spree_advanced_cart.git', :branch => '0-60-x'
 22
 23 gem 'rack-timeout'
 24
 25 # Dev/Test/Stage/Prod gems
 26 group :production, :staging do
 27 gem 'pg'
 28 #gem 'rails_12factor'
 29 end
 30
 31 group :development, :test do
 32 gem 'sqlite3'
 33 gem 'webrat'
 34 gem 'cucumber-rails'
 35 gem 'rspec-rails'
 36 end

And here's my Rakefile (minus identifying namespace):


  1 # Add your own tasks in files placed in lib/tasks ending in .rake,
  2 # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
  3
  4 require File.expand_path('../config/application', __FILE__)
  5 require 'rake'
  6
  7 [namespace]::Application.load_tasks

解决方案

Schneems at Heroku got to the bottom of this. Although there'd never been a version of the rack-timeout version of this app specified, that was the root of the problem.

I believe at some point as well the Gemfile.lock file was generated on a Windows machine, which was keeping Heroku couldn't reuse my lock file (this predates me - I've only ever deployed using OS X).

I specified gem 'rack-timeout', '0.3.2', ran bundle install, and lo and behold the deploy was successful.

Many thanks to Schneems!

这篇关于Heroku '无法检测到 rake 任务'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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