🐥
"Redmine" on windows
"Redmine"(レッドマイン)について
- オープンソースの課題管理システム。
- 課題やタスクをチケットとして登録し、実施した作業を記録していくことで資産として残せる。
- プロジェクト管理、タスク管理、イベント開催時の管理、お客様とのお問い合わせ対応の管理にも利用できる。
| 主な機能 |
|---|
| "チケット"を使った課題や問題の追跡管理機能 |
| ガントチャート機能 |
| カレンダー表示機能 |
| サマリー表示機能 |
| プロジェクトや組織に関する文書やメモなど用途を問わず作成できるWiki機能 |
| SubversionやGitといったバージョン管理システムと連携できる |
| ユーザー同士でテーマごとに議論するときに役に立つ掲示板機能(フォーラム) |
- "Redmine"以外には、Jooto(ジョートー)などがある。
"Redmine"デモサイト
"Redmine"公式:日本語ドキュメント
"Redmine" on windows
- 今回はDBをファイルで処理したいため、SQLサーバーを使用せずに
SQLiteで構築する。 -
webrick,ImageMagick,rmagickをインストールしてから"Redmine"をインストールしないとエラーが出る。
<参考サイト>
"Redmine"のダウンロード
-
redmineのwindows版をダウンロードして解凍する。
https://redmine.jp/download/
- 解凍したら、インストールしたい場所へ移動する。
database.ymlファイルの作成
- 解凍した
redmineの中にあるconfigフォルダ内で、database.yml.exampleファイルをコピーしてdatabase.ymlにファイル名を変更する。 - そして、
database.ymlファイルをSQLite3用に編集する。
[SQLite3用のdatabase.ymlファイル]
# Default setup is given for MySQL 5.7.7 or later.
# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.
# Line indentation must be 2 spaces (no tabs).
#production:
# adapter: mysql2
# database: redmine
# host: localhost
# username: root
# password: ""
# Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7
# encoding: utf8mb4
# variables:
# Recommended `transaction_isolation` for MySQL to avoid concurrency issues is
# `READ-COMMITTED`.
# In case of MySQL lower than 8, the variable name is `tx_isolation`.
# See https://www.redmine.org/projects/redmine/wiki/MySQL_configuration
# transaction_isolation: "READ-COMMITTED"
#development:
# adapter: mysql2
# database: redmine_development
# host: localhost
# username: root
# password: ""
# Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7
# encoding: utf8mb4
# variables:
# transaction_isolation: "READ-COMMITTED"
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
#test:
# adapter: mysql2
# database: redmine_test
# host: localhost
# username: root
# password: ""
# Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7
# encoding: utf8mb4
# variables:
# transaction_isolation: "READ-COMMITTED"
# PostgreSQL configuration example
#production:
# adapter: postgresql
# database: redmine
# host: localhost
# username: postgres
# password: "postgres"
# SQLite3 configuration example
production:
adapter: sqlite3
database: db/redmine.sqlite3
# SQL Server configuration example
#production:
# adapter: sqlserver
# database: redmine
# host: localhost
# username: jenkins
# password: jenkins
対応するRubyバージョンの確認
-
Gemfileをテキストエディタで開くと、対応しているRubyのバージョンを確認できる。 -
Rubyをインストール済みの場合、コマンドプロンプトでruby -vと入力するとインストールされているRubyのバージョンを確認することができる。
[Gemfile]
source 'https://rubygems.org'
ruby '>= 3.1.0', '< 3.4.0'
gem 'rails', '7.2.2.1'
gem 'rouge', '~> 4.5'
gem 'mini_mime', '~> 1.1.0'
gem "actionpack-xml_parser"
gem 'roadie-rails', '~> 3.2.0'
gem 'marcel'
gem 'mail', '~> 2.8.1'
gem 'nokogiri', '~> 1.18.3'
gem 'i18n', '~> 1.14.1'
gem 'rbpdf', '~> 1.21.3'
gem 'addressable'
gem 'rubyzip', '~> 2.3.0'
gem 'propshaft', '~> 1.1.0'
gem 'rack', '>= 3.1.3'
# Ruby Standard Gems
gem 'csv', '~> 3.2.8'
gem 'net-imap', '~> 0.4.8'
gem 'net-pop', '~> 0.1.2'
gem 'net-smtp', '~> 0.4.0'
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin]
# TOTP-based 2-factor authentication
gem 'rotp', '>= 5.0.0'
gem 'rqrcode'
# HTML pipeline and sanitization
gem "html-pipeline", "~> 2.13.2"
gem "sanitize", "~> 6.0"
# Optional gem for LDAP authentication
group :ldap do
gem 'net-ldap', '~> 0.17.0'
end
# Optional gem for exporting the gantt to a PNG file
group :minimagick do
gem 'mini_magick', '~> 5.0.1'
end
# Optional CommonMark support, not for JRuby
group :common_mark do
gem "commonmarker", '~> 0.23.8'
gem 'deckar01-task_list', '2.3.2'
end
# Include database gems for the adapters found in the database
# configuration file
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
if File.exist?(database_file)
database_config = File.read(database_file)
# Requiring libraries in a Gemfile may cause Bundler warnings or
# unexpected behavior, especially if multiple gem versions are available.
# So, process database.yml through ERB only if it contains ERB syntax
# in the adapter setting. See https://www.redmine.org/issues/41749.
if database_config.match?(/^ *adapter: *<%=/)
require 'erb'
database_config = ERB.new(database_config).result
end
adapters = database_config.scan(/^ *adapter: *(.*)/).flatten.uniq
if adapters.any?
adapters.each do |adapter|
case adapter.strip
when /mysql2/
gem 'mysql2', '~> 0.5.0'
gem "with_advisory_lock"
when /postgresql/
gem 'pg', '~> 1.5.3'
when /sqlite3/
gem 'sqlite3', '~> 1.7.0'
when /sqlserver/
gem 'tiny_tds', '~> 2.1.2'
gem 'activerecord-sqlserver-adapter', '~> 7.2.0'
else
warn("Unknown database adapter `#{adapter}` found in config/database.yml, use Gemfile.local to load your own database gems")
end
end
else
warn("No adapter found in config/database.yml, please configure it first")
end
else
warn("Please configure your config/database.yml first")
end
group :development, :test do
gem 'debug'
end
group :development do
gem 'listen', '~> 3.3'
gem 'yard', require: false
gem 'svg_sprite', require: false
end
group :test do
gem "rails-dom-testing"
gem 'mocha', '>= 2.0.1'
gem 'simplecov', '~> 0.22.0', :require => false
gem "ffi", platforms: [:mingw, :x64_mingw, :mswin]
# For running system tests
gem 'puma'
gem "capybara", ">= 3.39"
gem 'selenium-webdriver', '>= 4.11.0'
# RuboCop
gem 'rubocop', '~> 1.68.0', require: false
gem 'rubocop-performance', '~> 1.22.0', require: false
gem 'rubocop-rails', '~> 2.27.0', require: false
gem 'bundle-audit', require: false
end
local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local")
if File.exist?(local_gemfile)
eval_gemfile local_gemfile
end
# Load plugins' Gemfiles
Dir.glob File.expand_path("../plugins/*/{Gemfile,PluginGemfile}", __FILE__) do |file|
eval_gemfile file
end
gem "webrick", "~> 1.9"
gem "rmagick", "~> 6.1"
Rubyのインストール
- https://rubyinstaller.org/downloads/ からインストールファイルをダウンロードできる。
| ダウンロードするファイル |
|---|
rubyinstaller-devkit~x64.exe |
SQLite3のインストール
- https://sqlite.org/index.html にアクセスして、"SQLite ダウンロード ページ"を開く。
- "Windows 用のコンパイル済みバイナリ"で、次の2つのファイルをダウンロードして解凍する。
| ダウンロードするファイル |
|---|
sqlite-dll-win-x64~.zip |
sqlite-tools-win-x64~.zip |
- 解凍したら次の2つのファイルを、
redmineの中にあるbinフォルダへコピーする。
binフォルダへコピーするファイル |
|---|
sqlite3.exe |
sqlite3.dll |
"Remdmine"のインストール
-
webrick,ImageMagick,rmagickをインストールしてから"Remdmine"をインストールする。
- コマンドプロンプトを立ち上げて、
remdmineのディレクトリへ移動する。 - コマンドプロンプトで
gem install webrickを入力してwebrickをインストールする。 -
rmagickをインストールするために、ImageMagickをインストールする。
ImageMagickは、[https://imagemagick.org/script/download.php#windows](https://
imagemagick.org/script/download.php#windows)でダウンロード可能。
| "ImageMagick": ダウンロードしてインストールファイル |
|---|
ImageMagick-~-Q16-x64-static.exe |
ImageMagickインストール中のSetupのダイアログで、 Install development headers and libraries for C and C++にチェックを入れる。
-
ImageMagickをインストールしたら、ImageMagickのPATHをセットする:set Path=%PATH%;C:\usr\local\ImageMagick-〇〇〇-Q16-HDRI; - コマンドプロンプトを立ち上げなおす。
-
rmagickをインストールする:gem install rmagick - 公式の手順通りに
Bundlerを実行:bundle install --without development test
-
webrickとrmagickが入っていないため、手動で追加:bundle add webrick rmagick - セッションストア秘密鍵を生成する:
bundle exec rake generate_secret_token - データベースのテーブル等の作成:
set RAILS_ENV=production
bundle exec rake db:migrate - デフォルトデータをデータベースに登録する:
set RAILS_ENV=production
bundle exec rake redmine:load_default_data
"Redmine"インストールの確認
- コマンドプロンプトで、
bundle exec rails s -e productionを実行する。 - ブラウザで
http://localhost:3000/へアクセスして動作を確認する。
Discussion