LoginSignup
8
7

More than 1 year has passed since last update.

Windows10にRedmineをインストールした

Last updated at Posted at 2022-12-21

Windows10 に Ruby3.1 + Redmine 5.0.4 をインストールした作業メモ

Redmine とは

公式サイトを見ても分からない人がこの記事を読んでも理解できるわけがないので、ここでは説明しない。スキルのある人は公式サイトを見ていただけると有難い。

2022年現在、Redmine のインストール方法を検索したら Redmine packaged by Bitnami を使ってインストールする的な内容が殆どだった。パッケージを使えばコツコツとパーツを揃える必要がないので楽なのは分かる。Ruby や mysql を全部自前で入れていくのは面倒なので流行らないのだろうか。

今までに Redmine をインストールした経験は何度かあって、仕事用に Linux にも入れたし、個人的に自分でプロジェクトを管理するために、Windows にインストールしたこともあった。その経験があったので、そんなに面倒だったかな、割とサクっとできたような気もするけど…と思って自分で全部やってみたら、案外手強い。ハマった所は隠蔽して書いているからサクっと入ったみたいに見えると思うが、実は数日かかっている。

教訓の意味も込めて、手順を書いておく。

なお、今回は Redmine をインストールする手順を示すことが目的なので、それ以外のツールのインストール手順は特に示さない。

Redmine のインストール手順は、次のページの内容に従った。

検索して出てくる日本語ページはちょっと古いが、だいたいやっていることは同じだ。

環境

Windows 10 Pro
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x64-mingw-ucrt]
Rails 6.1.7
Redmine 5.0.4
MariaDB 10.4.27 (XAMPP 8.1.12)

前準備

Ruby

今回はバージョン 3.1 を使う。RubyInstaller for Windows のページから、
rubyinstaller-devkit-3.1.3-1-x64.exe
をダウンロードした。

インストール先はどこでもいいが、今回はデフォルトではなく C:\usr\local\ruby\Ruby31-x64 を指定した。

作業はコマンドプロンプトで行うので、パスが通っていることを確認する。

webrick

Ruby をインストールしたら、
gem install webrick
を実行する。

C:\usr\local\ruby\Ruby31-x64>gem install webrick
Fetching webrick-1.7.0.gem
Successfully installed webrick-1.7.0
Parsing documentation for webrick-1.7.0
Installing ri documentation for webrick-1.7.0
Done installing documentation for webrick after 2 seconds
1 gem installed

これを忘れると最後の動作確認で webrick が起動できないが、その時にインストールしても問題ない。

MySQL

XAMPP をインストールする。

XAMPP には現在 MySQL 互換の MariaDB がインストールされている。互換性があるのでこれを使う。余計なものまでインストールされるが気にしない。

Redmine のインストール

Redmine のインストール手順は、先に紹介した公式サイトのインストール手順のページに出てくる Step に合わせて書いていく。

Step 1 - Redmine本体のインストール

公式サイトからダウンロードする。

今回は redmine-5.0.4.zip をダウンロードして、C:\usr\local\redmine\redmine-5.0.4 に展開した。

Step 2 - 空のデータベースとユーザーの作成

XAMPP のコントロールパネルから MySQL を起動しておく。

コマンドラインから mysql client を起動して、MYSQLの場合、に書いてあるコマンドを実行する。

C:\xampp\mysql>bin\mysql -u root --default-character-set=utf8
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.4.27-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE redmine CHARACTER SET utf8mb4;
Query OK, 1 row affected (0.012 sec)

MariaDB [(none)]> CREATE USER 'redmine'@'localhost' IDENTIFIED BY '********}';
Query OK, 0 rows affected (0.010 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
Query OK, 0 rows affected (0.010 sec)

MariaDB [(none)]>

パスワードの箇所は伏せておいた。

Step 3 - データベースに接続するための設定

config/database.yml を作成・編集して、先程設定したパスワードを書いておく。

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "********"
  # Use "utf8" instead of "utfmb4" for MySQL prior to 5.7.7
  encoding: utf8mb4

********の所は mysql に登録したパスワードを指定する。

Step 4 - 依存するソフトウェアのインストール

mysql2

はい?

と思うかもしれないが、これを先にやっておかないと何かハマるので、mysql-connector-c++ をダウンロードしておく。

ここから、Windows (x86, 32-bit), ZIP Archive を選択してダウンロードする。(64-bit も試してみたが、install の所でエラーになった。)

/usr/local/mysql-connector-c++-8.0.30-win32 に展開しておき、これを --with-mysql-dir= で指定して、Ruby をインストールしたディレクトリに移動し、mysql2 をインストールする。

C:\usr\local\ruby\Ruby31-x64>gem install mysql2 -- --with-mysql-dir="/usr/local/mysql-connector-c++-8.0.30-win32"
Temporarily enhancing PATH for MSYS/MINGW...
Using msys2 packages: mingw-w64-ucrt-x86_64-libmariadbclient
Building native extensions with: '--with-mysql-dir=/usr/local/mysql-connector-c++-8.0.30-win32'
This could take a while...
Successfully installed mysql2-0.5.4
Parsing documentation for mysql2-0.5.4
Installing ri documentation for mysql2-0.5.4
Done installing documentation for mysql2 after 1 seconds
1 gem installed

この処理は少し時間がかかる。

ImageMagick

ImageMagick もハマりがちなので、先にインストールして、gem install rmagick を実行する。

ImageMagick をインストールするときの Setup のダイアログで、Install development headers and libraries for C and C++ のチェックを入れておくこと。

インストールはデフォルトの場所ではなく、C:\usr\local\ImageMagick-7.1.0-Q16-HDRI を指定した。今思えば \usr\ocal\ImageMagick にしておくべきだった。

この場合、公式ページには、次のように環境変数を指定するというヒント情報が書いてある。

set CPATH=C:\usr\local\ImageMagick-7.1.0-Q16-HDRI\include
set LIBRARY_PATH=C:\usr\local\ImageMagick-7.1.0-Q16-HDRI\lib

しかし、今回は次のようにコマンドプロンプトで ImageMagick をインストールしたパスを追加した。CPATHやLIBRARY_PATH は指定していない。

set Path=%PATH%;C:\usr\local\ImageMagick-7.1.0-Q16-HDRI;

これで gem install rmagick が実行できた。

C:\usr\local\ruby\Ruby31-x64>gem install rmagick
Fetching rmagick-5.1.0.gem
Fetching pkg-config-1.5.1.gem
Using msys2 packages: mingw-w64-ucrt-x86_64-pkg-config
Successfully installed pkg-config-1.5.1
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
Successfully installed rmagick-5.1.0
Parsing documentation for pkg-config-1.5.1
Installing ri documentation for pkg-config-1.5.1
Parsing documentation for rmagick-5.1.0
Installing ri documentation for rmagick-5.1.0
Done installing documentation for pkg-config, rmagick after 2 seconds
2 gems installed

Bundler

ここからは公式の手順通り。

C:\usr\local\redmine\redmine-5.0.4>bundle install --without development test
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local without 'development test'`, and stop using this flag
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies.....
Using rake 13.0.6
Fetching concurrent-ruby 1.1.10
Fetching minitest 5.16.3
Fetching zeitwerk 2.6.6
Fetching builder 3.2.4
Fetching erubi 1.11.0
Fetching racc 1.6.1
Fetching crass 1.0.6
Fetching rack 2.2.4
Installing erubi 1.11.0
Installing crass 1.0.6
Installing builder 3.2.4
Installing zeitwerk 2.6.6
Installing racc 1.6.1 with native extensions
Installing minitest 5.16.3
Installing rack 2.2.4
Installing concurrent-ruby 1.1.10
Fetching nio4r 2.5.8
Fetching websocket-extensions 0.1.5
Fetching marcel 1.0.2
Installing nio4r 2.5.8 with native extensions
Installing websocket-extensions 0.1.5
Installing marcel 1.0.2
Fetching mini_mime 1.1.2
Fetching method_source 1.0.0
Fetching thor 1.2.1
Installing mini_mime 1.1.2
Installing method_source 1.0.0
Installing thor 1.2.1
Fetching public_suffix 5.0.1
Installing public_suffix 5.0.1
Using bundler 2.3.26
Fetching chunky_png 1.4.0
Fetching commonmarker 0.23.6
Installing commonmarker 0.23.6 with native extensions
Installing chunky_png 1.4.0
Fetching csv 3.2.6
Fetching digest 3.1.1
Installing digest 3.1.1 with native extensions
Installing csv 3.2.6
Fetching htmlentities 4.3.4
Installing htmlentities 4.3.4
Fetching mini_magick 4.11.0
Using mysql2 0.5.4
Fetching timeout 0.3.1
Installing mini_magick 4.11.0
Installing timeout 0.3.1
Fetching strscan 3.0.5
Fetching net-ldap 0.17.1
Installing strscan 3.0.5 with native extensions
Fetching rbpdf-font 1.19.1
Installing net-ldap 0.17.1
Fetching redcarpet 3.5.1
Installing redcarpet 3.5.1 with native extensions
Using rexml 3.2.5
Fetching rotp 6.2.2
Installing rotp 6.2.2
Fetching rouge 3.28.0
Installing rouge 3.28.0
Installing rbpdf-font 1.19.1
Fetching rqrcode_core 1.2.0
Installing rqrcode_core 1.2.0
Fetching rubyzip 2.3.2
Installing rubyzip 2.3.2
Fetching websocket-driver 0.7.5
Installing websocket-driver 0.7.5 with native extensions
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching rack-test 2.0.2
Installing rack-test 2.0.2
Fetching request_store 1.5.1
Installing request_store 1.5.1
Fetching addressable 2.8.1
Installing addressable 2.8.1
Fetching i18n 1.10.0
Installing i18n 1.10.0
Fetching tzinfo 2.0.5
Installing tzinfo 2.0.5
Fetching sprockets 4.2.0
Installing sprockets 4.2.0
Fetching net-protocol 0.2.1
Installing net-protocol 0.2.1
Fetching rqrcode 2.1.2
Installing rqrcode 2.1.2
Fetching rbpdf 1.20.1
Fetching css_parser 1.12.0
Installing rbpdf 1.20.1
Installing css_parser 1.12.0
Fetching activesupport 6.1.7
Fetching tzinfo-data 1.2022.7
Installing activesupport 6.1.7
Installing tzinfo-data 1.2022.7
Fetching net-pop 0.1.2
Installing net-pop 0.1.2
Fetching net-smtp 0.3.3
Installing net-smtp 0.3.3
Fetching globalid 1.0.0
Fetching activemodel 6.1.7
Installing globalid 1.0.0
Installing activemodel 6.1.7
Fetching activejob 6.1.7
Installing activejob 6.1.7
Fetching activerecord 6.1.7
Installing activerecord 6.1.7
Fetching nokogiri 1.13.10 (x64-mingw-ucrt)
Installing nokogiri 1.13.10 (x64-mingw-ucrt)
Fetching rails-dom-testing 2.0.3
Fetching loofah 2.19.1
Fetching html-pipeline 2.13.2
Fetching roadie 5.1.0
Fetching sanitize 6.0.0
Installing rails-dom-testing 2.0.3
Installing loofah 2.19.1
Installing html-pipeline 2.13.2
Installing roadie 5.1.0
Installing sanitize 6.0.0
Fetching rails-html-sanitizer 1.4.4
Installing rails-html-sanitizer 1.4.4
Fetching deckar01-task_list 2.3.2
Installing deckar01-task_list 2.3.2
Fetching actionview 6.1.7
Installing actionview 6.1.7
Fetching actionpack 6.1.7
Installing actionpack 6.1.7
Fetching actioncable 6.1.7
Fetching activestorage 6.1.7
Fetching actionmailer 6.1.7
Fetching railties 6.1.7
Fetching sprockets-rails 3.4.2
Installing activestorage 6.1.7
Installing actionmailer 6.1.7
Installing sprockets-rails 3.4.2
Installing actioncable 6.1.7
Installing railties 6.1.7
Fetching actionmailbox 6.1.7
Fetching actiontext 6.1.7
Installing actiontext 6.1.7
Installing actionmailbox 6.1.7
Fetching actionpack-xml_parser 2.0.1
Fetching rails 6.1.7
Fetching roadie-rails 3.0.0
Installing rails 6.1.7
Installing actionpack-xml_parser 2.0.1
Installing roadie-rails 3.0.0
Using net-imap 0.2.3
Bundle complete! 43 Gemfile dependencies, 75 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Post-install message from html-pipeline:
-------------------------------------------------
Thank you for installing html-pipeline!
You must bundle Filter gem dependencies.
See html-pipeline README.md for more details.
https://github.com/jch/html-pipeline#dependencies
-------------------------------------------------
Post-install message from rubyzip:
RubyZip 3.0 is coming!
**********************

The public API of some Rubyzip classes has been modernized to use named
parameters for optional arguments. Please check your usage of the
following classes:
  * `Zip::File`
  * `Zip::Entry`
  * `Zip::InputStream`
  * `Zip::OutputStream`

Please ensure that your Gemfiles and .gemspecs are suitably restrictive
to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0).
See https://github.com/rubyzip/rubyzip for details. The Changelog also
lists other enhancements and bugfixes that have been implemented since
version 2.3.0.

webrick と rmagick が入っていないので、手動で追加しておく。

C:\usr\local\redmine\redmine-5.0.4>bundle add webrick rmagick
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using rake 13.0.6
Using concurrent-ruby 1.1.10
Using minitest 5.16.3
Using zeitwerk 2.6.6
Using builder 3.2.4
Using erubi 1.11.0
Using racc 1.6.1
Using crass 1.0.6
Using rack 2.2.4
Using bundler 2.3.26
Using nio4r 2.5.8
Using websocket-extensions 0.1.5
Using marcel 1.0.2
Using mini_mime 1.1.2
Using method_source 1.0.0
Using thor 1.2.1
Using public_suffix 5.0.1
Using chunky_png 1.4.0
Using commonmarker 0.23.6
Using csv 3.2.6
Using digest 3.1.1
Using htmlentities 4.3.4
Using mini_magick 4.11.0
Using mysql2 0.5.4
Using timeout 0.3.1
Using net-ldap 0.17.1
Using pkg-config 1.5.1
Using rbpdf-font 1.19.1
Using strscan 3.0.5
Using redcarpet 3.5.1
Using rexml 3.2.5
Using rotp 6.2.2
Using rouge 3.28.0
Using rqrcode_core 1.2.0
Using rubyzip 2.3.2
Using webrick 1.7.0
Using i18n 1.10.0
Using tzinfo 2.0.5
Using nokogiri 1.13.10 (x64-mingw-ucrt)
Using rack-test 2.0.2
Using sprockets 4.2.0
Using request_store 1.5.1
Using websocket-driver 0.7.5
Using mail 2.7.1
Using addressable 2.8.1
Using net-protocol 0.2.1
Using rbpdf 1.20.1
Using rmagick 5.1.0
Using activesupport 6.1.7
Using loofah 2.19.1
Using rqrcode 2.1.2
Using sanitize 6.0.0
Using tzinfo-data 1.2022.7
Using css_parser 1.12.0
Using net-imap 0.2.3
Using net-pop 0.1.2
Using net-smtp 0.3.3
Using rails-dom-testing 2.0.3
Using rails-html-sanitizer 1.4.4
Using globalid 1.0.0
Using activemodel 6.1.7
Using html-pipeline 2.13.2
Using roadie 5.1.0
Using activejob 6.1.7
Using actionview 6.1.7
Using activerecord 6.1.7
Using deckar01-task_list 2.3.2
Using actionpack 6.1.7
Using actioncable 6.1.7
Using activestorage 6.1.7
Using actionmailer 6.1.7
Using railties 6.1.7
Using sprockets-rails 3.4.2
Using actionmailbox 6.1.7
Using actionpack-xml_parser 2.0.1
Using actiontext 6.1.7
Using roadie-rails 3.0.0
Using rails 6.1.7

Step 5 - セッションストア秘密鍵の生成

手順通り。

C:\usr\local\redmine\redmine-5.0.4>bundle exec rake generate_secret_token

Step 6 - データベースのテーブル等の作成

手順通り。

C:\usr\local\redmine\redmine-5.0.4>set RAILS_ENV=production

C:\usr\local\redmine\redmine-5.0.4>bundle exec rake db:migrate
== 1 Setup: migrating =========================================================
-- create_table("attachments", {:options=>"ENGINE=InnoDB", :force=>true, :id=>:integer})
   -> 0.0136s

この後1800行程度の大量のメッセージが表示された。

Step 7 - デフォルトデータ

手順通り。
lang はデフォルトの en でもいいのだが、今回は指定せずにbundle を実行して、途中で ja を指定した。

C:\usr\local\redmine\redmine-5.0.4>set RAILS_ENV=production

C:\usr\local\redmine\redmine-5.0.4>bundle exec rake redmine:load_default_data

Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, es-PA, et, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] ja
====================================
Default configuration data loaded.

Step 8 は Windows の場合は必要ないので省略。

Step 9 - インストールの確認

公式ページの手順は

bundle exec rails server webrick

となっているが、これだとうまく行かないので、

bundle exec rails s -e production

を実行する。

C:\usr\local\redmine\redmine-5.0.4>bundle exec rails s -e production
=> Booting WEBrick
=> Rails 6.1.7 application starting in production http://0.0.0.0:3000
=> Run `bin/rails server --help` for more startup options
[2022-12-21 15:28:28] INFO  WEBrick 1.7.0
[2022-12-21 15:28:28] INFO  ruby 3.1.3 (2022-11-24) [x64-mingw-ucrt]
[2022-12-21 15:28:28] INFO  WEBrick::HTTPServer#start: pid=16748 port=3000

ブラウザで http://localhost:3000/ を表示して動作を確認した。今回はここまで。

(2022-12-21 追記)
Path に ImageMagick が含まれていないと起動に失敗する。

ハマりポイント

この先はうまく行った人は読む必要がない。

mysql2

多分これが一番キツかった。mysql2 を先にインストールしておくだけで解決するのだが、気付かないとどうしようもない。どうやって気付いたのか謎。

ImageMagick

これは毎回ハマった記憶がある。そして大抵諦めていたので、今回ちゃんと入っていたら初成功かもしれない(笑)。

ちなみに、パスを指定しないと次のようなエラーになる。

C:\usr\local\ruby\Ruby31-x64>gem install rmagick
Fetching rmagick-5.1.0.gem
Fetching pkg-config-1.5.1.gem
Using msys2 packages: mingw-w64-ucrt-x86_64-pkg-config
Successfully installed pkg-config-1.5.1
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

    current directory: C:/usr/local/ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rmagick-5.1.0/ext/RMagick
C:/usr/local/ruby/Ruby31-x64/bin/ruby.exe -I C:/usr/local/ruby/Ruby31-x64/lib/ruby/3.1.0 extconf.rb
checking for Ruby version >= 2.3.0... yes
checking for magick... no
checking for identify... 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-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/usr/local/ruby/Ruby31-x64/bin/$(RUBY_BASE_NAME)
extconf.rb:416:in `magick_command': no executable found for ImageMagick (NotImplementedError)
        from extconf.rb:347:in `assert_has_dev_libs!'
        from extconf.rb:317:in `assert_can_compile!'
        from extconf.rb:46:in `initialize'
        from extconf.rb:441:in `new'
        from extconf.rb:441:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/usr/local/ruby/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/rmagick-5.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/usr/local/ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rmagick-5.1.0 for inspection.
Results logged to C:/usr/local/ruby/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/rmagick-5.1.0/gem_make.out

メッセージに no executable found とあることに気付けば対応できるはず。

webrick

Ruby 2 までは標準で入っていたらしい。

ちなみに、手順通りに動作確認すると、最初、こうなった。

C:\usr\local\redmine\redmine-5.0.4>bundle exec rails server webrick
Traceback (most recent call last):
        8: from bin/rails:4:in `<main>'
        7: from bin/rails:4:in `require'
        6: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `<top (required)>'
        5: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.7/lib/rails/command.rb:48:in `invoke'
        4: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.7/lib/rails/command/base.rb:69:in `perform'
        3: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        2: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        1: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.7/lib/rails/commands/server/server_command.rb:130:in `perform': wrong number of arguments (given 1, expected 0) (ArgumentError)
        9: from bin/rails:4:in `<main>'
        8: from bin/rails:4:in `require'
        7: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `<top (required)>'
        6: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.7/lib/rails/command.rb:48:in `invoke'
        5: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.7/lib/rails/command/base.rb:69:in `perform'
        4: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        3: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        2: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:20:in `run'
        1: from C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:34:in `rescue in run'
C:/usr/local/ruby/Ruby27-x64/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/base.rb:525:in `handle_argument_error': ERROR: "rails server" was called with arguments ["webrick"] (Thor::InvocationError)
Usage: "rails server -u [thin/puma/webrick] [options]"

雑記

今回、何度も Ruby3.1 や Redmine をインストールした。ということはアンインストールもした。

Ruby はインストーラーでインストールしているので、Windows の設定画面から「アプリ」を選択し、インストールされているアプリを探してアンインストールする。その後ファイルが残っているので、エクスぽローラーから完全消去する。

Redmine は zip を展開するだけなので、ディレクトリごと完全削除すればいい。このとき、mysql に database が残っているので、これも消したいなら mysql client から管理者権限で、
drop database redmine
を実行する。これでもユーザーが残っているが。

Redmine をインストールし直す時は、database.yml と configuration.yml をどこかにコピーしておくと、毎回作らなくて済むので楽。サクっとディレクトリごと消したらこれも消えるので、その前にコピーしておく。

8
7
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
8
7