Heroku 'Could not detect rake tasks'

坚强是说给别人听的谎言 提交于 2021-02-11 07:12:02

问题


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

回答1:


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!



来源:https://stackoverflow.com/questions/36610847/heroku-could-not-detect-rake-tasks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!