プログラムを中心とした個人的なメモ用のブログです。 タイトルは迷走中。
内容の保証はできませんのであしからずご了承ください。

2015/10/23

[Bitnami Redmine] プラグイン Backlogs をインストール

update2017/10/21 event_note2015/10/23 2:04

Bitnami Redmine に Backlog sをインストールしました。
ネット上のいろいろな記事を参考にしていると、いろいろな方が同じことをやろうとしてはまったらしく、手順をまとめてくれています。
しかし、それを参考にしてやってもはまったので、私の環境での方法をまとめておきます。

環境

  • OS:Windows 7 Professional (32bit)
  • Bitnami Redmine のバージョン:2.6.7

参考にさせていただいたサイト

手順

環境変数の設定

システムのプロパティから [詳細設定] > [環境変数] と進み、ユーザー環境変数に下記を追加します。

RAILS_ENV=production<br>
PATH=C:\BitNami\Redmine\ruby\bin;C:\BitNami\Redmine\imagemagic

RAILS_ENV は新規作成し、変数設定で =production を入力します。
PATH は、既存にある PATH の後に、; で区切ってから入力します。
パスは環境に応じて変更してください。

Backlogsのダウンロード

[スタートメニュー] > [BitNami Redmine Stack] > [Use BitNami Redmine Stack] でコマンドプロンプトを起動します。

C:\BitNami\Redmine\apps\redmine\htdocs\plugins に移動します。

cd .\apps\redmine\htdocs\plugins

Backlogs をダウンロードします。

git clone https://github.com/backlogs/redmine_backlogs.git

plugins フォルダに redmin_backlogs フォルダが作成されます。

必要 Gem をインストール

Backlogs プラグインを動かすために必要な、gem ツールをインストールします。
C:\BitNami\Redmine\apps\redmine\htdocs\plugins より以下のコマンドを入力します。

bundle install

しかし、私の場合、以下のエラーが表示されました。

Warning: this Gemfile contains multiple primary sources. Each source after the
first must include a block to indicate which gems should come from that source.
To downgrade this error to a warning, run `bundle config --delete
disable_multisource`.

redmine_backlogs 内の Gemfile をテキストエディタで開き、編集します。
最初の行の末尾に do を追加し、ファイルの最後の行に end を追加します。

source 'https://rubygems.org' do
# 中略
end

再び bundle install のコマンドを実行すると、今度は以下のエラーが表示されました。

You cannot specify the same gem twice with different version requirements.
You specified: thin (= 1.6.1) and thin (>= 0)

今度は Gemfile の以下の行をコメントアウトします。

gem "thin", :platforms => [:ruby]

再び bundle install のコマンドを実行すると、今度は以下のエラーが表示されました。

You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

If this is a development machine, remove the Gemfile freeze
by running `bundle install --no-deployment`.

オプションを付けてコマンドを再実行します。

bundle install --no-deployment

今度は正常に完了しました。
なお、社内などのプロキシ環境下では環境変数でプロキシサーバーの設定を行っていないと失敗します。

インストールしたgemをマイグレーションする

C:\BitNami\Redmine\apps\redmine\htdocs\plugins より以下のコマンドを入力します。

bundle exec rake redmine:plugins:migrate RAILS_ENV=production
bundle exec rake tmp:cache:clear
bundle exec rake tmp:sessions:clear

Backlogsプラグインをマイグレーション

途中でストーリ・タスクで使用するトラッカーを設定しなければならないので、あらかじめ Redmine でトラッカーを作成しておきます。
以下のサイトを参考に、ストーリー タスク というトラッカーを作成しました。

トラッカーを作成した後で、C:\BitNami\Redmine\apps\redmine\htdocs\plugins より以下のコマンドを入力します。

bundle exec rake redmine:backlogs:install RAILS_ENV=production

正常にインストールが通ると、以下のようなメッセージが表示されるので、該当する番号を入力します。

-----------------------------------------------------
Which trackers do you want to use for your stories?
1. バグ
2. 機能
3. サポート
4. ストーリー
5. タスク
Separate values with a space (e.g. 1 3): 4

インストールが完了したら Redmine を再起動します。
[スタートメニュー] > [BitNami Redmine Stack] > [BitNami Redmine Stack Manager Tool] を起動して再起動しましょう。