Skip to content

Instantly share code, notes, and snippets.

@farrokhi
Last active April 4, 2025 10:39
Show Gist options
  • Save farrokhi/cbe56cb7923dca6fdf41c7f79e9edd92 to your computer and use it in GitHub Desktop.
Save farrokhi/cbe56cb7923dca6fdf41c7f79e9edd92 to your computer and use it in GitHub Desktop.
Upgrade mastodon via git
# as root
systemctl stop mastodon-web mastodon-sidekiq mastodon-streaming
su - mastodon
cd live
# as mastodon user, in its live direcotry
export MASTODON_VER=v4.3.7
export RAILS_ENV=production
git fetch && git checkout ${MASTODON_VER}
bundle install
yarn install
bundle exec rails db:migrate
bundle exec rails assets:precompile
exit
# assuming you are root now
systemctl start mastodon-web mastodon-sidekiq mastodon-streaming
### You might need to install / update ruby, if you run into errors like
### rbenv: version `x.x.x' is not installed (set by /home/mastodon/live/.ruby-version)
### Then:
git -C /home/mastodon/.rbenv/plugins/ruby-build pull
export RUBY_CONFIGURE_OPTS=--with-jemalloc
rbenv install x.x.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment