###前提・実現したいこと
Heroku,Python3.6を利用してLineBotの開発をしています。
heroku-buildpack-linuxbrewを利用して、MecabをHerokuにインストールしようとしていますが、Herokuのフリープランの最大Slug size500MGを超えてしまいBuildができません。
下記↓の記事を参考にして進めております。
Herokuでpython+mecab+ffmpegを使う
Herokuでmecab-python3を使う
###ディレクトリ構造
App
├ .buildpacks
├ .cellar
├ main.py
├Procfile
├requirements.txt
├run.sh
└ runtime.txt
###発生している問題・エラーメッセージ
.buildpacks
https://github.com/sunny4381/heroku-buildpack-linuxbrew.git
.cellar
mecab mecab-ipadic
build時のエラーメッセージ
=====> Downloading Buildpack: https://github.com/sunny4381/heroku-buildpack-linuxbrew.git =====> Detected Framework: linuxbrew -----> Installing linuxbrew Cloning into '/app/.linuxbrew'... export PATH="$HOME/.linuxbrew/bin:$PATH" export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH" export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH" export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH" -----> Installing mecab using brew ==> Migrating from Linuxbrew/brew to Homebrew/brew Linuxbrew/brew has been merged into Homebrew/brew! Linuxbrew/brew will no longer be updated. Your git remote has been changed from https://github.com/Linuxbrew/brew.git to https://github.com/Homebrew/brew See the blog post at https://brew.sh/2019/02/02/homebrew-2.0.0/ Updating Homebrew... ==> Downloading https://linuxbrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz #=#=# ==> Pouring portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz ==> Tapping homebrew/core Cloning into '/app/.linuxbrew/Library/Taps/homebrew/homebrew-core'... Tapped 2 commands and 5405 formulae (5,704 files, 408.4MB). Warning: Building mecab from source as the bottle needs: - HOMEBREW_CELLAR: /home/linuxbrew/.linuxbrew/Cellar (yours is /app/.linuxbrew/Cellar) - HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew (yours is /app/.linuxbrew) - HOMEBREW_REPOSITORY: /home/linuxbrew/.linuxbrew/Homebrew (yours is /app/.linuxbrew) ==> Downloading https://deb.debian.org/debian/pool/main/m/mecab/mecab_0.996.orig.tar.gz ==> ./configure --prefix=/app/.linuxbrew/Cellar/mecab/0.996 --sysconfdir=/app/.linuxbrew/etc ==> make install ???? /app/.linuxbrew/Cellar/mecab/0.996: 20 files, 4.8MB, built in 1 minute 24 seconds -----> Installing mecab-ipadic using brew Warning: Building mecab-ipadic from source as the bottle needs: - HOMEBREW_CELLAR: any_skip_relocation (yours is /app/.linuxbrew/Cellar) - HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew (yours is /app/.linuxbrew) - HOMEBREW_REPOSITORY: /home/linuxbrew/.linuxbrew/Homebrew (yours is /app/.linuxbrew) ==> Downloading https://deb.debian.org/debian/pool/main/m/mecab-ipadic/mecab-ipadic_2.7.0-20070801+main.orig.tar.gz ==> ./configure --prefix=/app/.linuxbrew/Cellar/mecab-ipadic/2.7.0-20070801 --with-charset=utf8 --with-dicdir=/app/.linuxbrew/Cellar/mecab-ipadic/2.7.0-20070801/lib/mecab/dic/ipadic ==> make install ==> Caveats To enable mecab-ipadic dictionary, add to /app/.linuxbrew/etc/mecabrc: dicdir = /app/.linuxbrew/lib/mecab/dic/ipadic ==> Summary ???? /app/.linuxbrew/Cellar/mecab-ipadic/2.7.0-20070801: 16 files, 50.6MB, built in 10 seconds Using release configuration from last framework (linuxbrew). -----> Python app detected ! Python has released a security update! Please consider upgrading to python-3.6.12 Learn More: https://devcenter.heroku.com/articles/python-runtimes -----> Installing python-3.6.3 -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2 -----> Installing SQLite3 -----> Installing requirements with pip Collecting Flask==0.12.2 Downloading Flask-0.12.2-py2.py3-none-any.whl (83 kB) Collecting line-bot-sdk==1.17.0 Downloading line_bot_sdk-1.17.0-py2.py3-none-any.whl (61 kB) Collecting mecab-python3 Downloading mecab_python3-1.0.3-cp36-cp36m-manylinux1_x86_64.whl (487 kB) Collecting click>=2.0 Downloading click-7.1.2-py2.py3-none-any.whl (82 kB) Collecting Jinja2>=2.4 Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB) Collecting Werkzeug>=0.7 Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB) Collecting itsdangerous>=0.21 Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB) Collecting requests>=2.0 Downloading requests-2.25.0-py2.py3-none-any.whl (61 kB) Collecting future Downloading future-0.18.2.tar.gz (829 kB) Collecting MarkupSafe>=0.23 Downloading MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl (27 kB) Collecting chardet<4,>=3.0.2 Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB) Collecting idna<3,>=2.5 Downloading idna-2.10-py2.py3-none-any.whl (58 kB) Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.2-py2.py3-none-any.whl (136 kB) Collecting certifi>=2017.4.17 Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB) Building wheels for collected packages: future Building wheel for future (setup.py): started Building wheel for future (setup.py): finished with status 'done' Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491058 sha256=f5a4a87490ffa2ee57f1311fa6888e81a8a608370ce82c466ce26107c1499858 Stored in directory: /tmp/pip-ephem-wheel-cache-6ru6stt2/wheels/6e/9c/ed/4499c9865ac1002697793e0ae05ba6be33553d098f3347fb94 Successfully built future Installing collected packages: click, MarkupSafe, Jinja2, Werkzeug, itsdangerous, Flask, chardet, idna, urllib3, certifi, requests, future, line-bot-sdk, mecab-python3 Successfully installed Flask-0.12.2 Jinja2-2.11.2 MarkupSafe-1.1.1 Werkzeug-1.0.1 certifi-2020.12.5 chardet-3.0.4 click-7.1.2 future-0.18.2 idna-2.10 itsdangerous-1.1.0 line-bot-sdk-1.17.0 mecab-python3-1.0.3 requests-2.25.0 urllib3-1.26.2 -----> Discovering process types Procfile declares types -> web -----> Compressing... ! Compiled slug size: 509.5M is too large (max is 500M). ! See: http://devcenter.heroku.com/articles/slug-size ! Push failed
###原因
Mecab自体のインストールは60MBくらいなので、brewのtapに400MB超えているのが問題だと考えております。
上記のエラー文の9行目以下が原因だと思うのですが、具体的な解決策が見当たりません。
是非ご教授いただきたけたらと思います。
-----> Installing mecab using brew ==> Migrating from Linuxbrew/brew to Homebrew/brew Linuxbrew/brew has been merged into Homebrew/brew! Linuxbrew/brew will no longer be updated. Your git remote has been changed from https://github.com/Linuxbrew/brew.git to https://github.com/Homebrew/brew See the blog post at https://brew.sh/2019/02/02/homebrew-2.0.0/ Updating Homebrew... ==> Downloading https://linuxbrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz #=#=# ==> Pouring portable-ruby-2.6.3_2.x86_64_linux.bottle.tar.gz ==> Tapping homebrew/core Cloning into '/app/.linuxbrew/Library/Taps/homebrew/homebrew-core'... Tapped 2 commands and 5405 formulae (5,704 files, 408.4MB). Warning: Building mecab from source as the bottle needs:
あなたの回答
tips
プレビュー