mokky14's IT diary

IT関係の仕事メモ、勉強会の感想など書いてます。

RedmineにAgileプラグインをインストール

Redmine使ってみて、チケットをかんばんの形で表示するプラグイン探してみたところ、Agileプラグインでいけそうだったのでインストールしてみた。

環境

  • OS : CentOS6.5
  • Redmine : 2.6.0-1
  • ruby : 2.2.2p95
  • gem : 2.4.5
  • bundler : 1.9.4

ダウンロード

プラグインRedmine pluginsからダウンロードする。 ダウンロードにはユーザ登録が必要。
多機能な有償版もあるようだが、今回はフリー版の redmine_agile-1_3_8-light.zip をダウンロード。

インストール

Redmine Agile plugin installation - Agile plugin - Redmine pluginsの手順に従いインストールを実施。
Redmine2.6.0の場合、pluginsディレクトリは、Redmineインストールディレクトリのapps/redmine/htdocs/plugins/ になる。

[root@centos6 htdocs]# pwd
/opt/redmine-2.6.0-1/apps/redmine/htdocs/plugins/
[root@centos6 plugins]# unzip /tmp/redmine_agile-1_3_8-light.zip
[root@centos6 redmine_agile]# bundle install --without development test
Fetching source index from https://rubygems.org/
Could not fetch specs from https://rubygems.org/

Proxy未設定によるエラーと思われるため、Proxyを設定。

[root@centos6 redmine_agile]# vi ~/.gemrc
http_proxy: http://proxyuser:proxypass@proxyhost:proxyport

再度実行。

[root@centos6 redmine_agile]# bundle install --without development test
Fetching gem metadata from https://rubygems.org/.........
Using rake (10.3.2)
Using i18n (0.6.11)
Using multi_json (1.10.1)
Using activesupport (3.2.19)
(途中略)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby extconf.rb
checking for ruby/thread.h... no
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
(途中略)

An error occurred while installing mysql2 (0.3.14), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.14'` succeeds before bundling.

mysql2のインストールでエラー。
エラーメッセージにしたがってgem installしてみる。

[root@centos6 redmine_agile]# gem install mysql2 -v 0.3.14 -r -p http://proxyuser:proxypass@proxyhost:proxyport
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
checking for ruby/thread.h... yes
(途中略)
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
(途中略)
        --without-mysqlclientlib


Gem files will remain installed in /usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.14 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.0.0/gems/mysql2-0.3.14/ext/mysql2/gem_make.out

mysql-develがインストールされてないとダメらしい。mysql-develインストールしてからmysql2インストールする。

[root@centos6 redmine_agile]# yum -y install mysql-devel
[root@centos6 redmine_agile]# gem install mysql2 -v 0.3.14 -r -p http://proxyuser:proxypass@proxyhost:proxyport
Building native extensions.  This could take a while...
Successfully installed mysql2-0.3.14
Parsing documentation for mysql2-0.3.14
unable to convert "\xE0" from ASCII-8BIT to UTF-8 for lib/mysql2/mysql2.so, skipping
Installing ri documentation for mysql2-0.3.14
1 gem installed

mysql2のインストールに成功。Agileプラグインのインストールに戻る。

[root@centos6 redmine_agile]# bundle install --without development test
(途中略)
Net::HTTPServerException: 407 "Proxy Authentication Required"
An error occurred while installing ruby-openid (2.3.0), and Bundler cannot continue.
Make sure that `gem install ruby-openid -v '2.3.0'` succeeds before bundling.

なぜかProxyの認証エラー。
色々試したが、最終的には一旦ログアウトして、再度ログインして実行したら動いた。

[root@centos6 htdocs]# bundle install --without development test
(途中略)
<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!

インストール手順に従い、次のコマンド実行。

[root@centos6 htdocs]# bundle exec rake redmine:plugins NAME=redmine_agile RAILS_ENV=production
/usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.9.4/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /opt/redmine-2.6.0-1/apps/redmine/htdocs in PATH, mode 040777
/opt/redmine-2.6.0-1/apps/redmine/htdocs/vendor/bundle/ruby/2.2.0/gems/activesupport-3.2.19/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
Migrating redmine_agile (Redmine Agile plugin (Light version))...
==  CreateIssueStatusOrders: migrating ========================================
-- create_table(:issue_status_orders)
   -> 0.3914s
-- add_index(:issue_status_orders, :issue_id)
   -> 0.0539s
-- add_index(:issue_status_orders, :position)
   -> 0.0218s
==  CreateIssueStatusOrders: migrated (0.4674s) ===============================

==  CreateAgileColors: migrating ==============================================
-- create_table(:agile_colors)
   -> 0.0135s
-- add_index(:agile_colors, :container_id)
   -> 0.0240s
-- add_index(:agile_colors, :container_type)
   -> 0.0230s
==  CreateAgileColors: migrated (0.0607s) =====================================

==  RenameIssueStatusOrders: migrating ========================================
-- rename_table(:issue_status_orders, :agile_ranks)
   -> 0.0049s
==  RenameIssueStatusOrders: migrated (0.0050s) ===============================

手順に従い、Redmine再起動。 再起動後、ブラウザからRedmineのページを開き、管理→プラグインを確認。 無事インストール出来たっぽい。

f:id:mokky14:20150417154537p:plain

使う

プロジェクトの設定→モジュールから、Agileにチェックを入れることで、該当プロジェクトでプラグインが有効になる。

f:id:mokky14:20150417155445p:plain

プラグインを有効にした後、「Agile」タブをクリックすると、かんばんが表示される。

f:id:mokky14:20150417160750p:plain

チケットのステータスは設定したワークフローに従って表示される。 個々のチケットはドラッグ&ドロップで移動可能。
同じステータスのチケットの表示順も変えられるので、優先順の並べ替えが可能。

チケットに表示する情報はAgile pluginの設定画面から設定可能。

f:id:mokky14:20150417163340p:plain

やりたい事は出来るようなのでこれで運用してみる。

参考:
Redmineのアジャイル開発向けプラグイン - torutkの日記
https://groups.google.com/forum/#!topic/redmine-users-ja/r836-uwS2gM
gem install実行時、Proxyサーバ認証ユーザに @ を含む場合のTips - 会長@腹部日記(2013-05-08) Proxy環境でgem install - Qiita
gem インストール時に発生したエラーとその解決方法まとめ - kzy52's blog