+++ date = "2021-05-06" tags = ["heroku"] title = "mastodon v3.3.0をstack:heroku-20に対応する方法" slug = "heroku" +++ stack:heroku-20でmastodon v3.3.0に対応する方法です。 ### libvpx5 以下のエラーが出てしまいますが、これは、heroku-20で使用されるubuntu 20.04がlibvpx6を使用するのに対し、mastodonはlibvpx5を使用するためだと思われます。 > remote: E: Unable to locate package libvpx5 したがって、`mastodon/Aptfile`を書き換えます。 ``` - libvpx5 + libvpx[5-9] ``` 追記:zundaさんがpull-reqされていました。 https://github.com/tootsuite/mastodon/pull/15591 ### ruby v2.7.3 heroku-20は、最も古いのがruby v2.5.9です。したがって、Gemfile.lockを変更する必要があります。 https://devcenter.heroku.com/articles/ruby-support ```sh $ cd ./mastodon $ yay -S rbenv ruby-build $ rbenv init $ rbenv install 2.7.3 $ rbenv local 2.7.3 $ gem i bundler $ bundle # git push -f heroku main $ git push -f heroku master ``` bundleを実行するのは何でもいいですけど、archで実行後にGemfile.lockをcpしてgit-pushしました。 ### mastodon v3.3.0 `SKIP_POST_DEPLOYMENT_MIGRATIONS=true`は特殊だけど、他はいつも通りのコマンド。 ```sh $ heroku run RAILS_ENV=production bin/tootctl cache clear $ heroku run SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate $ heroku run RAILS_ENV=production bundle exec rails assets:precompile ``` https://github.com/tootsuite/mastodon/releases/tag/v3.3.0