【发布时间】:2020-09-21 12:11:16
【问题描述】:
我在配置中更改了 nothing(没有新的 gem 或版本更改);只有一行代码,但我现在无法推送到heroku。 heroku 一定发生了一些变化?
它是 Rails 3.2.22.5;红宝石 2.3.1。 (是的,我正在升级到 Rails 5,但这是一项艰巨的工作,同时我还需要维护现有的生产系统。)
RAILS_ENV=生产包 exec rake -P 工作正常。我不认为这真的是一个rake问题。我最好的猜测是 heroku 发生了一些变化,以至于不再支持我拥有的某些版本,但我不知道是什么。而且我没有收到任何信息性错误消息。
不知所措...我已经在 Google 上进行了广泛的搜索,但大多数帖子都是 4 年以上的。我尝试在本地预编译并仅签入清单文件。我尝试升级 rake(从 13.0.0 到 13.0.1),但由于没有任何效果,所以我把所有东西都放回去了。
remote: Bundle complete! 54 Gemfile dependencies, 118 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into `./vendor/bundle`
remote: Bundle completed (0.51s)
remote: Cleaning up the bundler cache.
remote: -----> Writing config/database.yml to read from DATABASE_URL
remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Detecting rake tasks
remote:
remote: !
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.
remote: ! bash: /tmp/build_785c3bf77f08cff81f442938e3386876/bin/rake: /app/vendor/ruby-2.3.1/bin/ruby: bad interpreter: No such file or directory
remote: !
remote: /tmp/buildpackvv7B3/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
【问题讨论】:
-
我同意,我也不认为这是一个 rake 问题。当您运行
RAILS_ENV=production bundle exec rake -P时,是在您的heroku dyno 上还是在本地?如果没有,我会尝试在测功机上运行该命令。如果在那里成功,请键入which ruby以查看安装 ruby 的路径。我猜它不应该指向每个/app/vendor/ruby-2.3.1/bin/ruby: bad interpreter的供应商目录。如果它没有指向那条路径,那么某些东西正指向那条路径。 -
感谢您的回复!我在两个地方都这样做了,而且效果很好。事实证明,我们认为它不是 rake 是正确的——这是一个 buildpack 问题。我正在用解决方案在下面回答我自己的问题。
标签: ruby-on-rails git heroku ruby-on-rails-3.2 rake