OSX10.11のRedmineを3.2.0に更新した

OSX 10.11 (El Capitan) にて、Redmineを3.0.0から3.2.0に更新した。

環境

問題

  • ffiインストールにてエラーが発生した。

詳細

  • いつもの様に更新を試みるが、ffiのNative Extension生成に失敗してしまう。
$ bundle install
...
Installing ffi 1.9.10 with native extensions

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile

make "DESTDIR=" 
...
An error occurred while installing ffi (1.9.10), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.10'` succeeds before bundling.

原因

  • "checking for ffi.h... no"という表示が出る時点でおかしい。libffiはHomebrewで既にインストール済みなのだ。
$ brew info libffi
libffi: stable 3.0.13 (bottled), HEAD [keg-only]
Portable Foreign Function Interface library
https://sourceware.org/libffi/
/usr/local/Cellar/libffi/3.0.13 (13 files, 388K)
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/libffi.rb
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

Some formulae require a newer version of libffi.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/libffi/lib
  • しかし、上記の説明をよく見てみれば"keg-only"なのでリンクは設定されていないらしい。Fomulaを確認したところ、下記の記載があった。

flags = ["-L#{lib}", "-lffi", "-I#{lib}/libffi-#{version}/include"]

https://github.com/Homebrew/homebrew/blob/master/Library/Formula/libffi.rb
  • パスを明示したところ、今度はインストールに成功した。
$ gem install ffi -- --with-opt-dir=/usr/local/opt/libffi --with-opt-include=/usr/local/opt/libffi/lib/libffi-3.0.13/include
Building native extensions with: '--with-opt-dir=/usr/local/opt/libffi --with-opt-include=/usr/local/opt/libffi/lib/libffi-3.0.13/include'
This could take a while...
Successfully installed ffi-1.9.10
Parsing documentation for ffi-1.9.10
Done installing documentation for ffi after 0 seconds
1 gem installed
  • この後の更新手順は前回までと同様だ。

既知の問題

LDAP認証の問題

既に3.2.1向けのチケットに上がっているけれど、LDAPアカウントの生成時に非ASCII文字が含まれていると失敗してしまうらしい。これは会社内で利用するには厳しい制約だろう。プラグインを以前のバージョン(?)へ戻せば回避は可能なようだ。

I confirm this bug, redmine 3.2.0 with net-ldap-0.12.1. If I rollback on net-ldap-0.3.1 - all is ok.

Defect #21453: LDAP account creation fails when first name/last name contain non ASCII - Redmine