英雄联盟“=10=”
Heroku 'Could not detect rake tasks'
我有一个部署到 Heroku 的遗留应用程序突然无法编译。它在本地运行良好,我上次在 3 月 23 日部署它时没有出现任何问题。现在我正在尝试推动一个小的变化 - 一个 link 添加到视图。
我知道此应用使用的是 Ruby / Rails / Spreecommerce - 1.9.3 / 3.0.20 / 0.60 不受支持的版本。我们有更新计划,但与此同时我需要让这个改变生效。
来自 Heroku 的错误是:
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.
rake 任务在本地完成。我仔细检查了 Rakefile,但没有发现任何问题。它也在 4 年内进行了更新,在此期间每月多次部署都不是问题。在 6 个月内也没有任何 Gemfile 更改,我已经确认该应用程序在本地运行。
这是我的 Gemfile(带有之前开发人员的模糊个人存储库):
1 source '<a href="http://rubygems.org" rel="nofollow">http://rubygems.org</a>'
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
</pre>
这是我的 Rakefile(减去标识命名空间):
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
Heroku 的 Schneems 弄清了真相。尽管从未指定此应用程序的 rack-timeout 版本,但这是问题的根源。
我相信在某些时候 Gemfile.lock 文件是在 Windows 机器上生成的,这使得 Heroku 无法重用我的锁定文件(这早于我 - 我只曾使用 OS X 部署过)。
我指定了 gem 'rack-timeout', '0.3.2'
、运行 捆绑安装,你瞧,部署成功了。
非常感谢 Schneems!
我有一个部署到 Heroku 的遗留应用程序突然无法编译。它在本地运行良好,我上次在 3 月 23 日部署它时没有出现任何问题。现在我正在尝试推动一个小的变化 - 一个 link 添加到视图。
我知道此应用使用的是 Ruby / Rails / Spreecommerce - 1.9.3 / 3.0.20 / 0.60 不受支持的版本。我们有更新计划,但与此同时我需要让这个改变生效。
来自 Heroku 的错误是:
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.
rake 任务在本地完成。我仔细检查了 Rakefile,但没有发现任何问题。它也在 4 年内进行了更新,在此期间每月多次部署都不是问题。在 6 个月内也没有任何 Gemfile 更改,我已经确认该应用程序在本地运行。
这是我的 Gemfile(带有之前开发人员的模糊个人存储库):
1 source '<a href="http://rubygems.org" rel="nofollow">http://rubygems.org</a>' 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 </pre>
这是我的 Rakefile(减去标识命名空间):
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
Heroku 的 Schneems 弄清了真相。尽管从未指定此应用程序的 rack-timeout 版本,但这是问题的根源。
我相信在某些时候 Gemfile.lock 文件是在 Windows 机器上生成的,这使得 Heroku 无法重用我的锁定文件(这早于我 - 我只曾使用 OS X 部署过)。
我指定了 gem 'rack-timeout', '0.3.2'
、运行 捆绑安装,你瞧,部署成功了。
非常感谢 Schneems!