mastodon アップデート(ubuntu20.04) 殴り書き
Mastodon

#サービス停止
systemctl stop mastodon-*
#ユーザー切り替え
su - mastodon
#フォルダ移動
cd live
#最新バージョンを取得
git fetch --tags origin
# 取得したら目的のタグに切り換える。
git checkout v4.0.x
#bundlerでgem等を更新
bundle install
#以下は必要なRubyのバージョンが入っていないというエラー
ruby-build: definition not found: 3.3.x
See all available versions with rbenv install --list-all'.
If the version you need is missing, try upgrading ruby-build:
git -C /home/mastodon/.rbenv/plugins/ruby-build pull
#以下でインストールできるRubyバージョンを確認
rbenv install --list-all
#バージョンが見つからない場合、Rubyの最新バージョンを取得
git -C /home/mastodon/.rbenv/plugins/ruby-build pull
#必要なRubyバージョンをインストール
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.3.x
#インストールしたRubyバージョンを適用
rbenv global 3.3.x
#再度bundlerでgem等を更新
bundle install
#yarnでフロントエンド周辺を更新
yarn install
# DBの構成変更がある場合はdb:migrateを実行する(何も無い場合も実行しても何も起こらない)
RAILS_ENV=production bundle exec rake db:migrate
# フロントエンドのCSSやJSの更新とパッケージング(これがチョット長い)
RAILS_ENV=production bundle exec rake assets:precompile
#rootユーザーに戻る
exit
#各種サービスの開始
systemctl start mastodon-web
systemctl start mastodon-sidekiq
systemctl start mastodon-streaming
#mastodon-streamではエラーになるので注意