【问题标题】:Could not detect rake tasks when deploying a rails app部署 Rails 应用程序时无法检测到 rake 任务
【发布时间】:2021-04-09 19:26:27
【问题描述】:

我正在尝试在 heroku 上部署一个 rails(版本 6.1.0)应用程序并遇到一些错误。我的捆绑器版本是 2.2.4。我尝试了以下操作,但仍然遇到相同的错误

  1. 运行 $ bundle exec rake -P
  2. 运行 RAILS_ENV=production bundle exec rake assets:precompile
  3. 将 BUNDLED WITH 版本更改为 2.1.4
  4. 尝试在 Digital Ocean App 上部署

所有这些都给了我这个错误信息

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:  !     /tmp/build_955ddefb/config/boot.rb:4:in `require': cannot load such file -- bootsnap/setup (LoadError)
remote:  !     from /tmp/build_955ddefb/config/boot.rb:4:in `<top (required)>'
remote:  !     from /tmp/build_955ddefb/bin/rake:3:in `require_relative'
remote:  !     from /tmp/build_955ddefb/bin/rake:3:in `<main>'

【问题讨论】:

    标签: ruby-on-rails ruby heroku


    【解决方案1】:

    你的 Heroku 版本是什么?我在 Rails 6.0.4,bundle 2.1.4 上工作,我用rake assets:precompile 解决了这个问题,在我推动之前,我降级到 heroku-18 heroku stack:set heroku-18。 希望能有所帮助。

    【讨论】:

      猜你喜欢
      • 2021-05-06
      • 2019-07-01
      • 2021-04-11
      • 1970-01-01
      • 1970-01-01
      • 2021-04-14
      • 2019-06-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多