【发布时间】:2021-01-20 17:36:42
【问题描述】:
我又遇到了这个错误...我不记得我第一次尝试使用 .slugignore 文件时是如何修复的,以排除我不需要用于 slug 大小的主文件夹的东西是供应商,和节点模块,我用过
Heroku run bash -a businessappk3400
» Warning: Heroku update available from 7.42.5 to 7.42.8.
Running bash on ⬢ businessappk3400... up, run.8800 (Standard-1X)
~ $ du -sh * | sort -hr
得到了:
所以我正在考虑减少供应商和节点模块文件,我尝试将它们放在我在根文件夹中创建的 .slugignore 文件夹中,如下所示:
.slugignore:
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
./log
./tmp
./storage
./public
./node_modules
./yarn-error.log
./heroku
./vendor
./vendor/bundle
./kevin
./kevin.pug
./package-lock.json
./config/environments/database.yml
./package-lock.json
./vendor/database.yml
./public/packs
./public/packs-test
./yarn-error.log
./yarn-debug.log
.yarn-integrity
但我仍然通过了 slug 的 500mb 限制...有人解决了这个问题吗?
错误:
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
builder (1.02 MiB)
js/builder-ba7328e435e703a663b7.js
Asset precompilation completed (268.67s)
Cleaning assets
Running: rake assets:clean
-----> Detecting rails configuration
###### WARNING:
You have not declared a Ruby version in your Gemfile.
To declare a Ruby version add this line to your Gemfile:
```
ruby "2.6.6"
```
For more information see:
https://devcenter.heroku.com/articles/ruby-versions
###### WARNING:
Removing `Gemfile.lock` because it was generated on Windows.
Bundler will do a full resolve so native gems are handled properly.
This may result in unexpected gem versions being used in your app.
In rare occasions Bundler may not be able to resolve your dependencies at all.
https://devcenter.heroku.com/articles/bundler-windows-gemfile
###### WARNING:
Detecting rails configuration failed
set HEROKU_DEBUG_RAILS_RUNNER=1 to debug
-----> Discovering process types
Procfile declares types -> web, worker
Default types for buildpack -> console, rake
-----> Compressing...
! Compiled slug size: 565.7M is too large (max is 500M).
! See: http://devcenter.heroku.com/articles/slug-size
! Push failed
完整的错误可以在这里找到:https://codepen.io/apesyntax/pen/oNLvWdB
【问题讨论】:
标签: ruby-on-rails ruby heroku deployment slug