プロジェクト

全般

プロフィール

RedmineのバージョンアップーRocky Linux 8とUnicornとNginx編

はじめに

CentOS 8がサポート終了後、CentOS 8互換のディストリビューションの一つRocky Linux 8に移行してRedmineを動かしています。
今回は、Redmine 5.0から5.1へのバージョンアップを実施します。

Redmine 5.1の動作条件

公式サイトの Redmine 5.1.0 released によると

  • Ruby 2.6以前のサポートはなし、2.7-3.2に対応

Rocky Linux 8のruby対応

Rocky Linux 8.8で現在使用しているrubyバージョンは2.6でした。

~$ dnf info ruby

利用可能なパッケージ
名前         : ruby
バージョン   : 2.6.10
リリース     : 109.module+el8.6.0+988+8031c193
  :

Rocky Linux 8が採用しているパッケージ管理システム dnf では、同じパッケージ(ruby)を複数バージョン管理することができます。
まず、現在利用できるrubyバージョンの一覧を確認します。

$ dnf module list ruby
Rocky Linux 8 - AppStream
Name Stream  Profiles       Summary
ruby 2.5 [d] common [d]     An interpreter of object-oriented scripting language
ruby 2.6 [e] common [d] [i] An interpreter of object-oriented scripting language
ruby 2.7     common [d]     An interpreter of object-oriented scripting language
ruby 3.0     common [d]     An interpreter of object-oriented scripting language
ruby 3.1     common [d]     An interpreter of object-oriented scripting language

ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled

ruby 2.6が [e]および[i]となっており、現在有効化されインストールされていることが分かります。
ruby 2.7, 3.0, 3.1が提供されているので、Rocky Linuxの標準リポジトリから、Redmine 5.1のサポート対象 Rubyバージョン 2.7-3.2に含まれる ruby が利用できることが分かりました。
今回は、対応バージョンのうちRocky Linuxで利用できる最も新しい Rubyバージョン 3.1を入れることにします。

バージョンアップ作業

Rubyバージョンアップ

Rocky Linux 8.8のrubyバージョンを2.6から3.1にバージョンアップします。

まず、現在のモジュールリストは次です。

$ dnf module list ruby
Rocky Linux 8 - AppStream
Name Stream  Profiles       Summary
ruby 2.5 [d] common [d]     An interpreter of object-oriented scripting language
ruby 2.6 [e] common [d] [i] An interpreter of object-oriented scripting language
ruby 2.7     common [d]     An interpreter of object-oriented scripting language
ruby 3.0     common [d]     An interpreter of object-oriented scripting language
ruby 3.1     common [d]     An interpreter of object-oriented scripting language

ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled

現在有効化されている ruby 2.6を無効化する必要があります。

~$ sudo dnf module reset ruby -y
  :
~$ sudo dnf module list ruby
Rocky Linux 8 - AppStream
Name  Stream   Profiles    Summary
ruby  2.5 [d]  common [d]  An interpreter of object-oriented scripting language
ruby  2.6      common [d]  An interpreter of object-oriented scripting language
ruby  2.7      common [d]  An interpreter of object-oriented scripting language
ruby  3.0      common [d]  An interpreter of object-oriented scripting language
ruby  3.1      common [d]  An interpreter of object-oriented scripting language

ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled

次に、ruby 3.1を有効化します。

~$ sudo dnf module enable ruby:3.1 -y
~$ sudo dnf module list ruby
Rocky Linux 8 - AppStream
Name  Stream   Profiles    Summary
ruby  2.5 [d]  common [d]  An interpreter of object-oriented scripting language
ruby  2.6      common [d]  An interpreter of object-oriented scripting language
ruby  2.7      common [d]  An interpreter of object-oriented scripting language
ruby  3.0      common [d]  An interpreter of object-oriented scripting language
ruby  3.1 [e]  common [d]  An interpreter of object-oriented scripting language

ヒント: [d]efault, [e]nabled, [x]disabled, [i]nstalled

dnfのパッケージ管理上、ruby 3.1 が有効化されました。まだインストールはされていないのでインストールします。

~$ sudo dnf install ruby
メタデータの期限切れの最終確認: 0:47:16 前の 2023年11月03日 10時13分01秒 に実施 しました。
パッケージ ruby-2.6.10-109.module+el8.6.0+988+8031c193.x86_64 は既にインストールされています。
依存関係が解決しました。
================================================================================
 パッケージ      Arch   バージョン                              Repo      サイズ
================================================================================
アップグレード:
 ruby            x86_64 3.1.2-141.module+el8.7.0+1081+f0a69743  appstream  88 k
 ruby-devel      x86_64 3.1.2-141.module+el8.7.0+1081+f0a69743  appstream 511 k
 ruby-libs       x86_64 3.1.2-141.module+el8.7.0+1081+f0a69743  appstream 3.3 M
 rubygem-bigdecimal
                 x86_64 3.1.1-141.module+el8.7.0+1081+f0a69743  appstream 113 k
 rubygem-io-console
                 x86_64 0.5.11-141.module+el8.7.0+1081+f0a69743 appstream  72 k
 rubygem-json    x86_64 2.6.1-141.module+el8.7.0+1081+f0a69743  appstream  99 k
 rubygem-psych   x86_64 4.0.3-141.module+el8.7.0+1081+f0a69743  appstream  98 k
 rubygems        noarch 3.3.7-141.module+el8.7.0+1081+f0a69743  appstream 319 k
依存関係のインストール:
 ruby-default-gems
                 noarch 3.1.2-141.module+el8.7.0+1081+f0a69743  appstream  78 k
     置き換え  rubygem-did_you_mean.noarch 1.3.0-109.module+el8.6.0+988+8031c193
     置き換え  rubygem-openssl.x86_64 2.1.2-109.module+el8.6.0+988+8031c193

トランザクションの概要
================================================================================
インストール    1 パッケージ
アップグレード  8 パッケージ

ダウンロードサイズの合計: 4.6 M
これでよろしいですか? [y/N]: y

続行すると、ruby 2.6からruby 3.1へのアップグレードが実施されます。

ruby 3.1でのパッケージ更新

ruby を3.1にしたことにより、rubyに関係するパッケージのアップデートが可能となります。(例、rubygem-bundler)
bundlerは、アップデートをしておいた方が良いようです。

$ sudo dnf update
================================================================================
 パッケージ       Arch   バージョン                             Repo      サイズ
================================================================================
アップグレード:
 binutils         x86_64 2.30-119.el8_8.2                       baseos    5.8 M
 firewalld        noarch 0.9.11-1.el8_8                         baseos    508 k
 firewalld-filesystem
                  noarch 0.9.11-1.el8_8                         baseos     77 k
 python3-firewall noarch 0.9.11-1.el8_8                         baseos    433 k
 rubygem-bundler  noarch 2.3.7-141.module+el8.7.0+1081+f0a69743 appstream 448 k
 rubygem-irb      noarch 1.4.1-141.module+el8.7.0+1081+f0a69743 appstream 126 k
 rubygem-rdoc     noarch 6.4.0-141.module+el8.7.0+1081+f0a69743 appstream 517 k

トランザクションの概要
================================================================================
アップグレード  7 パッケージ

ダウンロードサイズの合計: 7.9 M
これでよろしいですか? [y/N]:

rubyをバージョンアップすると...

rubyのバージョンアップをしたので、Redmineを再起動して動作させようとすると、接続できず、unicornが起動失敗していました。

11月 03 11:03:42 redmine-host redmine-unicorn[1369]: bundler: command not found: unicorn_rails -c config/unicorn.rb -E production

Redmineのbundlerでインストールしたgemsモジュールはrubyバージョンに依存しているので、/var/lib/redmine/vendor/bundler/ruby/2.6.0/の下にインストールされたgemsモジュール(unicornを含む)が見つからない状態になってしまっています。

bundlerの再インストール

rubyのバージョンを変更すると、bundlerの下のgemsを再度インストールし直す必要があります。

redmine$ bundle update
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies....
Fetching rake 13.1.0 (was 13.0.6)
Installing rake 13.1.0 (was 13.0.6)
Fetching concurrent-ruby 1.2.2 (was 1.1.10)
Fetching minitest 5.20.0 (was 5.16.2)
Fetching zeitwerk 2.6.12 (was 2.6.0)
Installing zeitwerk 2.6.12 (was 2.6.0)
Fetching builder 3.2.4
Installing minitest 5.20.0 (was 5.16.2)
Fetching erubi 1.12.0 (was 1.11.0)
Installing concurrent-ruby 1.2.2 (was 1.1.10)
Installing builder 3.2.4
Installing erubi 1.12.0 (was 1.11.0)
Fetching mini_portile2 2.8.5 (was 2.8.0)
Fetching racc 1.7.2 (was 1.6.0)
Fetching crass 1.0.6
Installing mini_portile2 2.8.5 (was 2.8.0)
Installing racc 1.7.2 (was 1.6.0) with native extensions
Fetching rack 2.2.8 (was 2.2.4)
Installing crass 1.0.6
Fetching nio4r 2.5.9 (was 2.5.8)
Installing rack 2.2.8 (was 2.2.4)
Installing nio4r 2.5.9 (was 2.5.8) with native extensions
Fetching websocket-extensions 0.1.5
Installing websocket-extensions 0.1.5
Fetching marcel 1.0.2
Installing marcel 1.0.2
Fetching mini_mime 1.1.5 (was 1.1.2)
Installing mini_mime 1.1.5 (was 1.1.2)
Fetching method_source 1.0.0
Installing method_source 1.0.0
Fetching thor 1.3.0 (was 1.2.1)
Fetching public_suffix 5.0.3 (was 4.0.7)
Installing thor 1.3.0 (was 1.2.1)
Using bundler 2.3.7
Fetching chunky_png 1.4.0
Installing public_suffix 5.0.3 (was 4.0.7)
Fetching commonmarker 0.23.4
Installing chunky_png 1.4.0
Installing commonmarker 0.23.4 with native extensions
Fetching csv 3.2.7 (was 3.2.3)
Installing csv 3.2.7 (was 3.2.3)
Fetching digest 3.1.1 (was 3.1.0)
Installing digest 3.1.1 (was 3.1.0) with native extensions
Fetching ffi 1.16.3 (was 1.15.5)
Installing ffi 1.16.3 (was 1.15.5) with native extensions
Fetching htmlentities 4.3.4
Installing htmlentities 4.3.4
Fetching kgio 2.11.4
Installing kgio 2.11.4 with native extensions
Fetching mini_magick 4.11.0
Installing mini_magick 4.11.0
Fetching mysql2 0.5.5 (was 0.5.4)
Installing mysql2 0.5.5 (was 0.5.4) with native extensions
Fetching timeout 0.4.0 (was 0.3.0)
Installing timeout 0.4.0 (was 0.3.0)
Fetching strscan 3.0.7 (was 3.0.4)
Installing strscan 3.0.7 (was 3.0.4) with native extensions
Fetching net-ldap 0.17.1
Installing net-ldap 0.17.1
Fetching raindrops 0.20.1 (was 0.20.0)
Installing raindrops 0.20.1 (was 0.20.0) with native extensions
Fetching rbpdf-font 1.19.1
Installing rbpdf-font 1.19.1
Fetching redcarpet 3.5.1
Installing redcarpet 3.5.1 with native extensions
Fetching rexml 3.2.6 (was 3.2.5)
Installing rexml 3.2.6 (was 3.2.5)
Fetching rotp 6.3.0 (was 6.2.0)
Installing rotp 6.3.0 (was 6.2.0)
Fetching rouge 3.28.0
Installing rouge 3.28.0
Fetching rqrcode_core 1.2.0
Installing rqrcode_core 1.2.0
Fetching rubyzip 2.3.2
Installing rubyzip 2.3.2
Fetching i18n 1.10.0
Installing i18n 1.10.0
Fetching tzinfo 2.0.6 (was 2.0.5)
Fetching rack-test 2.1.0 (was 2.0.2)
Installing tzinfo 2.0.6 (was 2.0.5)
Installing rack-test 2.1.0 (was 2.0.2)
Fetching sprockets 4.2.1 (was 4.1.1)
Fetching request_store 1.5.1
Installing request_store 1.5.1
Fetching websocket-driver 0.7.6 (was 0.7.5)
Installing sprockets 4.2.1 (was 4.1.1)
Fetching mail 2.7.1
Installing websocket-driver 0.7.6 (was 0.7.5) with native extensions
Installing mail 2.7.1
Fetching nokogiri 1.13.10 (x86_64-linux) (was 1.13.8)
Fetching addressable 2.8.5 (was 2.8.0)
Installing addressable 2.8.5 (was 2.8.0)
Fetching get_process_mem 0.2.7
Installing get_process_mem 0.2.7
Fetching net-protocol 0.2.1 (was 0.1.3)
Installing net-protocol 0.2.1 (was 0.1.3)
Fetching rbpdf 1.20.1
Installing rbpdf 1.20.1
Fetching rqrcode 2.2.0 (was 2.1.2)
Installing nokogiri 1.13.10 (x86_64-linux) (was 1.13.8)
Installing rqrcode 2.2.0 (was 2.1.2)
Fetching activesupport 6.1.6.1
Installing activesupport 6.1.6.1
Fetching css_parser 1.16.0 (was 1.11.0)
Fetching net-imap 0.2.3
Installing css_parser 1.16.0 (was 1.11.0)
Fetching net-pop 0.1.2 (was 0.1.1)
Installing net-imap 0.2.3
Fetching net-smtp 0.3.3 (was 0.3.1)
Installing net-pop 0.1.2 (was 0.1.1)
Fetching globalid 1.2.1 (was 1.0.0)
Installing net-smtp 0.3.3 (was 0.3.1)
Fetching activemodel 6.1.6.1
Installing globalid 1.2.1 (was 1.0.0)
Fetching rails-dom-testing 2.2.0 (was 2.0.3)
Installing activemodel 6.1.6.1
Fetching loofah 2.21.4 (was 2.18.0)
Installing rails-dom-testing 2.2.0 (was 2.0.3)
Fetching html-pipeline 2.13.2
Installing loofah 2.21.4 (was 2.18.0)
Installing html-pipeline 2.13.2
Fetching sanitize 6.1.0 (was 6.0.0)
Fetching roadie 5.1.0 (was 5.0.1)
Installing roadie 5.1.0 (was 5.0.1)
Installing sanitize 6.1.0 (was 6.0.0)
Fetching activejob 6.1.6.1
Fetching activerecord 6.1.6.1
Installing activejob 6.1.6.1
Fetching rails-html-sanitizer 1.5.0 (was 1.4.3)
Installing activerecord 6.1.6.1
Installing rails-html-sanitizer 1.5.0 (was 1.4.3)
Fetching deckar01-task_list 2.3.2
Installing deckar01-task_list 2.3.2
Fetching actionview 6.1.6.1
Fetching activerecord-compatible_legacy_migration 0.1.2
Installing activerecord-compatible_legacy_migration 0.1.2
Installing actionview 6.1.6.1
Fetching actionpack 6.1.6.1
Installing actionpack 6.1.6.1
Fetching actioncable 6.1.6.1
Fetching activestorage 6.1.6.1
Installing activestorage 6.1.6.1
Installing actioncable 6.1.6.1
Fetching actionmailer 6.1.6.1
Fetching railties 6.1.6.1
Installing actionmailer 6.1.6.1
Fetching sprockets-rails 3.4.2
Installing railties 6.1.6.1
Installing sprockets-rails 3.4.2
Fetching actionmailbox 6.1.6.1
Installing actionmailbox 6.1.6.1
Fetching actiontext 6.1.6.1
Fetching actionpack-xml_parser 2.0.1
Installing actiontext 6.1.6.1
Installing actionpack-xml_parser 2.0.1
Fetching roadie-rails 3.0.0
Fetching rails 6.1.6.1
Installing roadie-rails 3.0.0
Installing rails 6.1.6.1
Fetching unicorn 6.1.0
Installing unicorn 6.1.0 with native extensions
Fetching unicorn-worker-killer 0.4.5
Installing unicorn-worker-killer 0.4.5
Bundle updated!
Gems in the groups 'development' and 'test' were not updated.
Post-install message from html-pipeline:
-------------------------------------------------
Thank you for installing html-pipeline!
You must bundle Filter gem dependencies.
See html-pipeline README.md for more details.
https://github.com/jch/html-pipeline#dependencies
-------------------------------------------------
Post-install message from rubyzip:
RubyZip 3.0 is coming!
**********************

The public API of some Rubyzip classes has been modernized to use named
parameters for optional arguments. Please check your usage of the
following classes:
  * `Zip::File`
  * `Zip::Entry`
  * `Zip::InputStream`
  * `Zip::OutputStream`

Please ensure that your Gemfiles and .gemspecs are suitably restrictive
to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0).
See https://github.com/rubyzip/rubyzip for details. The Changelog also
lists other enhancements and bugfixes that have been implemented since
version 2.3.0.

Redmineのサーバー再起動

Ruby のバージョンアップの確認をするため、Unicornサーバーの再起動を行います。
サービスは、RedmineをCentOS 8上で動かすーUnicornとNginx編 で作成したものです。

~$ sudo systemctl restart redmine-unicorn
~$ sudo systemctl status redmine-unicorn
● redmine-unicorn.service - Redmine Unicorn Server
   Loaded: loaded (/usr/lib/systemd/system/redmine-unicorn.service; enabled; ve>
   Active: active (running) since Fri 2023-11-03 14:17:58 JST; 5s ago
   :

起動したRedmine上で、[管理]メニュー > [情報]でrubyバージョンを確認します。

Environment:
  Redmine version                5.0.2.stable
  Ruby version                   3.1.2-p20 (2022-04-12) [x86_64-linux]
  Rails version                  6.1.6.1

Redmineのバージョンアップ

現時点では、redmineのgitリポジトリから5.0-stableブランチをクローンした状態です。
今回、5.1-stableブランチに移行するので、移行方針として次の2つが考えられます。

  • 新たにgitリポジトリからクローンする
  • 現在のディレクトリのブランチを5.1-stableに切り替える
方法 メリット デメリット
新たにclone 問題があった場合にすぐに前の環境に戻すことが容易 新規インストールと近い作業が必要
設定ファイル、プラグイン、テーマやソースコードに手を入れていたものを移行する必要
ブランチ切替 作業が簡単 切替に問題があったときに前のバージョンに戻すことが難

今回は作業が容易なブランチ切替で進めます。問題があった場合に前のバージョンに戻すために、ディレクトリをコピーして作業します。

~$ cd /var/lib
lib$ sudo cp -pr redmine-5.0-stable redmine-5.1-stable
lib$

Redmineのブランチを切り替え

まず、git checkoutコマンドで状況を確認します。修正中の未コミットファイルがあるとブランチ切替ができません。

redmine-5.1-stable$ git checkout 5.1-stable
error: Your local changes to the following files would be overwritten by checkout:
        config.ru
        config/routes.rb
Please commit your changes or stash them before you switch branches.
Aborting

それぞれのファイルの差分を確認します。

  • git diff config.ru
@@ -1,4 +1,11 @@
 # This file is used by Rack-based servers to start the application.

+# Unicorn self-process killer
+require 'unicorn/worker_killer'
+# Max requests per worker
+use Unicorn::WorkerKiller::MaxRequests, 16384, 18432
+# Max memory size (RSS) per worker
+use Unicorn::WorkerKiller::Oom, (512*(1024**2)), (640*(1024**2))
+
 require ::File.expand_path('../config/environment',  __FILE__)
 run Rails.application
  • config/routes.rb
@@ -18,7 +18,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

 Rails.application.routes.draw do
-  root :to => 'welcome#index', :as => 'home'
+  root :to => 'wiki#show', :project_id => 'swe', :as => 'home'

   match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
   match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]

ローカルの変更を一時的にstashに保存します。

redmine-5.1-stable$ git stash save "5.0-stable changes" 
Saved working directory and index state On 5.0-stable: 5.0-stable changes

ブランチを切り替えます。

redmine-5.1-stable$ git checkout 5.1-stable
branch '5.1-stable' set up to track 'origin/5.1-stable'.
Switched to a new branch '5.1-stable'

切り替え後、更新を反映します。

redmine-5.1-stable$ git pull
  :

ローカルの修正(git stashしたもの)を反映します。

redmine-5.1-stable$ git stash pop
Auto-merging config.ru
CONFLICT (content): Merge conflict in config.ru
Auto-merging config/routes.rb
On branch 5.1-stable
Your branch is up to date with 'origin/5.1-stable'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   config/routes.rb

Unmerged paths:
  (use "git restore --staged <file>..." to unstage)
  (use "git add <file>..." to mark resolution)
        both modified:   config.ru

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        config/unicorn.rb
        public/_maintenance.html
        vendor/

The stash entry is kept in case you need it again.

config.ruファイルに競合が発生したので、手動で修正します。

# This file is used by Rack-based servers to start the application.

# Unicorn self-process killer
require 'unicorn/worker_killer'
# Max requests per worker
use Unicorn::WorkerKiller::MaxRequests, 16384, 18432
# Max memory size (RSS) per worker
use Unicorn::WorkerKiller::Oom, (512*(1024**2)), (640*(1024**2))

require_relative 'config/environment'
run Rails.application

git stash pop すると、stagingに上がってしまうので、git resetを実行してunstagingにしておきます。

Redmineが必要とするgemsモジュールの更新

redmine-5.1-stable$ bundle update
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies....................
Using rake 13.1.0
Using minitest 5.20.0
Using zeitwerk 2.6.12
Using builder 3.2.4
Using erubi 1.12.0
Using mini_portile2 2.8.5
Using racc 1.7.2
Using crass 1.0.6
Using rack 2.2.8
Using nio4r 2.5.9
Using websocket-extensions 0.1.5
Using marcel 1.0.2
Using mini_mime 1.1.5
Fetching date 3.3.3
Using timeout 0.4.0
Using method_source 1.0.0
Using thor 1.3.0
Using public_suffix 5.0.3
Using bundler 2.3.7
Using chunky_png 1.4.0
Fetching commonmarker 0.23.10 (was 0.23.4)
Using concurrent-ruby 1.2.2
Using csv 3.2.7
Using ffi 1.16.3
Using htmlentities 4.3.4
Using kgio 2.11.4
Fetching mini_magick 4.12.0 (was 4.11.0)
Installing mini_magick 4.12.0 (was 4.11.0)
Installing date 3.3.3 with native extensions
Installing commonmarker 0.23.10 (was 0.23.4) with native extensions
Using mysql2 0.5.5
Using net-ldap 0.17.1
Using raindrops 0.20.1
Using rbpdf-font 1.19.1
Fetching redcarpet 3.6.0 (was 3.5.1)
Installing redcarpet 3.6.0 (was 3.5.1) with native extensions
Using rexml 3.2.6
Using rotp 6.3.0
Fetching rouge 4.2.0 (was 3.28.0)
Installing rouge 4.2.0 (was 3.28.0)
Using rqrcode_core 1.2.0
Using rubyzip 2.3.2
Fetching i18n 1.14.1 (was 1.10.0)
Installing i18n 1.14.1 (was 1.10.0)
Using tzinfo 2.0.6
Fetching nokogiri 1.15.4 (x86_64-linux) (was 1.13.10)
Installing nokogiri 1.15.4 (x86_64-linux) (was 1.13.10)
Using rack-test 2.1.0
Using websocket-driver 0.7.6
Using net-protocol 0.2.1
Using addressable 2.8.5
Using get_process_mem 0.2.7
Using sprockets 4.2.1
Using request_store 1.5.1
Using unicorn 6.1.0
Fetching rbpdf 1.21.3 (was 1.20.1)
Installing rbpdf 1.21.3 (was 1.20.1)
Using rqrcode 2.2.0
Fetching activesupport 6.1.7.6 (was 6.1.6.1)
Installing activesupport 6.1.7.6 (was 6.1.6.1)
Using loofah 2.21.4
Using net-pop 0.1.2
Using net-smtp 0.3.3
Using css_parser 1.16.0
Using sanitize 6.1.0
Using unicorn-worker-killer 0.4.5
Using rails-dom-testing 2.2.0
Fetching rails-html-sanitizer 1.6.0 (was 1.5.0)
Installing rails-html-sanitizer 1.6.0 (was 1.5.0)
Using globalid 1.2.1
Fetching activemodel 6.1.7.6 (was 6.1.6.1)
Installing activemodel 6.1.7.6 (was 6.1.6.1)
Using html-pipeline 2.13.2
Fetching roadie 5.2.0 (was 5.1.0)
Installing roadie 5.2.0 (was 5.1.0)
Fetching actionview 6.1.7.6 (was 6.1.6.1)
Installing actionview 6.1.7.6 (was 6.1.6.1)
Fetching activejob 6.1.7.6 (was 6.1.6.1)
Installing activejob 6.1.7.6 (was 6.1.6.1)
Fetching activerecord 6.1.7.6 (was 6.1.6.1)
Installing activerecord 6.1.7.6 (was 6.1.6.1)
Using deckar01-task_list 2.3.2
Fetching actionpack 6.1.7.6 (was 6.1.6.1)
Installing actionpack 6.1.7.6 (was 6.1.6.1)
Using activerecord-compatible_legacy_migration 0.1.2
Fetching actioncable 6.1.7.6 (was 6.1.6.1)
Installing actioncable 6.1.7.6 (was 6.1.6.1)
Fetching activestorage 6.1.7.6 (was 6.1.6.1)
Installing activestorage 6.1.7.6 (was 6.1.6.1)
Fetching railties 6.1.7.6 (was 6.1.6.1)
Installing railties 6.1.7.6 (was 6.1.6.1)
Using sprockets-rails 3.4.2
Fetching actiontext 6.1.7.6 (was 6.1.6.1)
Installing actiontext 6.1.7.6 (was 6.1.6.1)
Using actionpack-xml_parser 2.0.1
Fetching roadie-rails 3.1.0 (was 3.0.0)
Installing roadie-rails 3.1.0 (was 3.0.0)
Fetching net-imap 0.3.7 (was 0.2.3)
Installing net-imap 0.3.7 (was 0.2.3)
Fetching mail 2.8.1 (was 2.7.1)
Installing mail 2.8.1 (was 2.7.1)
Fetching actionmailbox 6.1.7.6 (was 6.1.6.1)
Fetching actionmailer 6.1.7.6 (was 6.1.6.1)
Installing actionmailbox 6.1.7.6 (was 6.1.6.1)
Installing actionmailer 6.1.7.6 (was 6.1.6.1)
Fetching rails 6.1.7.6 (was 6.1.6.1)
Installing rails 6.1.7.6 (was 6.1.6.1)
Bundle updated!
Gems in the groups 'development' and 'test' were not updated.

DBマイグレーション実施

redmine-5.1-stable$ bundle exec rails db:migrate RAILS_ENV=production
  :
redmine-5.1-stable$ bundle exec rails tmp:clear RAILS_ENV=production

Unicorn起動スクリプトの修正

  • /usr/lib/systemd/system/redmine-unicorn.service
- WorkingDirectory=/var/lib/redmine-5.0-stable
+ WorkingDirectory=/var/lib/redmine-5.1-stable
- PIDFile=/var/lib/redmine-5.0-stable/tmp/pids/unicorn.pid
+ PIDFile=/var/lib/redmine-5.1-stable/tmp/pids/unicorn.pid

systemctlの定義ファイルを修正したら次を実施

$ sudo systemctl daemon-reload

/var/lib/redmine シンボリックリンク修正

lib$ ls -l redmine
lrwxrwxrwx. 1 root root 18 4月 26  2022 redmine -> redmine-5.0-stable
lib$ sudo rm redmine
lib$ sudo ln -s redmine-5.1-stable redmine
lib$ ls -l redmine
lrwxrwxrwx. 1 root root 18 11月  3 17:44 redmine -> redmine-5.1-stable


6ヶ月前に更新