我试图在heroku上部署一个rails(版本6.1.0(应用程序,但遇到了几个错误。我的bundler版本是2.2.4。我尝试过以下事情,但仍然得到相同的错误
- 运行$bundle exec-rake-P
- 运行RAILS_ENV=生产捆绑包exec-rake资产:预编译
- 将BUNDLED WITH版本更改为2.1.4
- 尝试在Digital Ocean应用程序上部署
所有这些都给了我这个错误消息
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>'
您的Heroku版本是哪一个?我在Rails 6.0.4,bundle 2.1.4上工作,我用rake assets:precompile
解决了这个问题,在推送之前,我降级到heroku-18heroku stack:set heroku-18
。希望会有所帮助。