LoginSignup
1
2

More than 5 years have passed since last update.

Conoha の Mastodon テンプレート 1.2 -> 1.4.3 にバージョンアップ(non Docker)

Last updated at Posted at 2017-06-20

背景

  • Conoha のテンプレートで Mastodon を立ち上げる
  • バージョンが古い(1.2系)なので 1.4.3 にあげるも precompile で止まる

目指すところ

  • 問題を回避して 1.4.3 にアップデートする

原因

  • mastodon ユーザーで yarn が実行できなかった(nodejs のインストールの仕方が悪かったかも?)

結果(手順)

必要なパッケージのインストールを以下の手順で行うことでエラーを回避できました。

各種アップデート

root で実行

npm install -g npm@3
npm install -g yarn@0.18.2
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install nodejs
apt-get install -y pkg-config libprotobuf-dev protobuf-compiler

nom と yarn は最新すぎると動かない報告があったのでバージョンを指定してインストール
node の更新に n を入れる方法もあったのですが、それだと mastodon ユーザーの時に動かなかったのでこちらの方法で入れる。

rails の更新

mastodon ユーザーに切り替えて作業

su mastodon

cd /home/mastodon/live
git fetch
git checkout v1.4.3
bundle install
yarn isntall

RAILS_ENV=production bundle exec rails mastodon:maintenance:prepare_for_foreign_keys
RAILS_ENV=production bundle exec rails assets:precompile
RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=production bundle exec rails r Rails.cache.clear

もし過去に root で git の操作をしてしまっていたらファイルの権限を見直してください。
問題なければここの precompile は通る!

mastodon の再起動

root に戻って作業

exit

systemctl restart mastodon-sidekiq
systemctl restart mastodon-streaming
systemctl restart mastodon-web

以上で 1.4.3 にあげることができました。

参考
リリースノート https://github.com/tootsuite/mastodon/releases
Conoha 公式 https://www.conoha.jp/guide/mastodon.php?btn_id=news_mastodon&_ga=2.167012218.536184911.1497860060-674940405.1444268309
1.4.1 のエラーについて https://github.com/tootsuite/mastodon/issues/3251

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2