LoginSignup
2
3

More than 1 year has passed since last update.

Lightsailのbitnami RedmineにRedmine Ganttプラグインを導入する

Posted at

Lightsailのbitnami RedmineにPlantUMLプラグインを導入するの続き。

bitnamiのRedmineを使っている関係上、実行ユーザーが管理者権限を持っているため、sudoを使用していますが、ご自身の環境に合わせて読み替えてください。

環境

Amazon LightsailのBitnami版Redmine

/etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Redmineの情報

Environment:
  Redmine version                4.1.1.stable
  Ruby version                   2.5.8-p224 (2020-03-31) [x86_64-linux]
  Rails version                  5.2.4.2
  Environment                    production
  Database adapter               Mysql2
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp

導入手順

Redmine Ganttプラグインを入手する

下記より、Redmine Ganttプラグインを入手します。
名前、メールアドレス、電話番号登録後、ダウンロードリンクが記載されたメールが送信されます。私の場合、メールの受信までに数分かかりました。

入手した圧縮ファイル(EasyGanttFree.zip)をサーバーにSCPコマンドでアップします。

$ scp -i [秘密鍵] EasyGanttFree.zip bitnami@[IPアドレス]:~/

プラグインのインストール

Redmine 4.1.1を使用しているため、EasyGanttFree-4.x.zipを解答し、pluginsディレクトリに配置します。

$ cd ~/
$ unzip EasyGanttFree.zip
$ unzip EasyGanttFree-4.x.zip 
$ mv easy_gantt/ ~/apps/redmine/htdocs/plugins/

プラグインファイルの権限変更

$ cd ~/apps/redmine/htdocs/plugins/
$ sudo chown -R bitnami.daemon easy_gantt
$ sudo chmod -R 775 easy_gantt

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

普通にプラグインをインストールしようとすると、下記のエラーが出る場合があります。

$ sudo bundle exec rake redmine:plugins NAME=easy_gantt RAILS_ENV=production

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 /opt/bitnami/apps/redmine/htdocs/Gemfile freez
e 
by running `bundle install --no-deployment`.

The dependencies in your gemfile changed

You have added to the Gemfile:
* redmine_extensions

エラーメッセージの指示通り、「bundle install --no-deployment」を実行します。
mimemagicでエラー(*1)が出たので、gemをアップデートし、再度bundle installします。

*1 参考 https://hackmd.io/@mametter/mimemagic-info-ja

$ cd ~/apps/redmine/htdocs/

$ sudo bundle install --no-deployment

Your bundle is locked to mimemagic (0.3.5), but that version could not be found in any of
the sources listed in your Gemfile. If you haven't changed sources, that means the author
of mimemagic (0.3.5) has removed it. You'll need to update your bundle to a version other
than mimemagic (0.3.5) that hasn't been removed in order to install.

$ sudo bundle update mimemagic

$ sudo bundle install --no-deployment

プラグインをインストールします。

$ sudo bundle exec rake redmine:plugins NAME=easy_gantt RAILS_ENV=production
== 20170213152215 AddDefaultPrintableTemplate: migrating ======================
== 20170213152215 AddDefaultPrintableTemplate: migrated (0.0000s) =============

== 20170224134615 UpdateRestApiSettings: migrating ============================
== 20170224134615 UpdateRestApiSettings: migrated (0.0183s) ===================

$ sudo bundle exec rake --trace db:migrate RAILS_ENV=production
※エラーが出るかもしれませんが、とりあえず下記のコマンドも実行します。

$ sudo bundle exec rake redmine:plugins:migrate RAILS_ENV=production

redmine関連を再起動します。

$ sudo /opt/bitnami/ctlscript.sh restart

画面上部の「Easy Gantt」をクリックし、下記の画面が表示されると成功です。

redmine.png

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3