torutkのブログ

ソフトウェア・エンジニアのブログ

Redmine 2.4.1から2.4.3へのアップデート(CentOS 6)

2014-02-08にリリースされたRedmine 2.4.3に、2.4.1からアップデートしました。
OSは、CentOS 6.4です。

手順は次と一緒です。
http://d.hatena.ne.jp/torutk/20130502/p1

マイナートラブルシュートメモ

Wiki extensionsプラグイン

リリース版は0.6.4ですが、リポジトリの最先端はさらに幾つか修正が入っています。Wiki extensionsプラグインリポジトリMercurial HGなので、hgコマンドで更新しようとしました。

まず、hgコマンド実行ユーザーと、.hg/hgrcのファイルの所有者とが一致していないと、セキュリティ上の理由でエラーとなってしまいます。

Not trusting file /var/lib/redmine-2.4.3/plugins/redmine_wiki_extensions/.hg/hgrc from untrusted user redmine, group redmine
Not trusting file /var/lib/redmine-2.4.3/plugins/redmine_wiki_extensions/.hg/hgrc from untrusted user redmine, group redmine
abort: repository default not found!

次に、最新版のWiki extensionsにアップデートしてしまうと、Wikiページの編集でInternal Errorとなってしまいました。0.6.4に戻して回避しました。

Completed 500 Internal Server Error in 239.4ms

ActionView::Template::Error (undefined method `tag_disabled' for #<WikiExtensionsSetting:0x00000005208870>):
    21:    tags = page.wiki_ext_tags.sort { |a, b| a.name <=> b.name }
    22:    baseurl = Redmine::Utils.relative_url_root
    23:    img = baseurl + "/images/add.png"
    24:    if WikiExtensionsUtil.tag_enabled? @project
    25: -%>
    26:
    27:
  lib/redmine/hook.rb:111:in `block in render_on'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:158:in `call_hook'
  app/views/layouts/base.html.erb:75:in `_app_views_layouts_base_html_erb__2341214072243697222_43291780'

ruby 2.1.0のインストール

ついでに、rubyを2.0.0から2.1.0に上げてみます。
ruby 2.1.0をrpmbuildでRPMパッケージ作成し、それをインストールします。
インストール後、unicornを起動するとエラーとなってしまいました。

$ sudo service unicorn start
/var/lib/redmine: Starting
/usr/lib64/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'bundler' (>= 0) among 8 total gem(s) (Gem::LoadError)
        from /usr/lib64/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
        from /usr/lib64/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
        from /usr/bin/bundle:22:in `<main>'

ruby 2.0.0環境で、bundlerは、システムにインストールしていたので、ruby 2.1.0にアップデートしたときに消えてしまったからです。そこで、再度bundlerをインストールします。

$ sudo gem install bundler --no-rdoc --no-ri
Fetching: bundler-1.5.3.gem (100%)
Successfully installed bundler-1.5.3
1 gem installed
$

さて、unicornを起動します。

$ sudo service unicorn start
/var/lib/redmine: Starting
bundler: command not found: unicorn_rails
Install missing gem executables with `bundle install`
$

あれ、駄目ですね。

rubyのバージョン(bundlerのバージョンかも)を上げたら、redmineのgem群を再度インストールする必要があるのかもしれません。redmine-2.4.3のディレクトリに移動し、bundle udpateを実行してみました。

$ cd /var/lib/redmine-2.4.3
$ sudo bundle update
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing rake (10.1.1)
Installing i18n (0.6.9)
Installing multi_json (1.8.4)
Installing activesupport (3.2.16)
Installing builder (3.0.0)
Installing activemodel (3.2.16)
Installing erubis (2.7.0)
Installing journey (1.0.4)
Installing rack (1.4.5)
Installing rack-cache (1.2)
Installing rack-test (0.6.2)
Installing hike (1.2.3)
Installing tilt (1.4.1)
Installing sprockets (2.2.2)
Installing actionpack (3.2.16)
Installing mime-types (1.25.1)
Installing polyglot (0.3.3)
Installing treetop (1.4.15)
Installing mail (2.5.4)
Installing actionmailer (3.2.16)
Installing arel (3.0.3)
Installing tzinfo (0.3.38)
Installing activerecord (3.2.16)
Installing activeresource (3.2.16)
Using bundler (1.5.3)
Installing coderay (1.1.0)
Installing rack-ssl (1.3.3)
Using json (1.8.1)
Installing rdoc (3.12.2)
Installing thor (0.18.1)
Installing railties (3.2.16)
Installing jquery-rails (2.0.3)
Installing kgio (2.9.1)
Installing mysql2 (0.3.15)
Installing net-ldap (0.3.1)
Installing ruby-openid (2.3.0)
Installing rack-openid (1.4.2)
Installing rails (3.2.16)
Installing raindrops (0.12.0)
Installing rmagick (2.13.2)
Installing unicorn (4.8.2)
Your bundle is updated!
Gems in the groups development and test were not installed.
$

あ、まえにbundle installをしたときは、/var/lib/redmine-2.4.3/vendor/bundler/ruby/2.0.0の下にgem群がインストールされたので、確かにgemをインストールし直す必要がありましたね。

さて、unicornを起動します。こんどはエラーにならずに立ち上がったようです。