somemo's diary

プログラマ、雑記、プログラミング関係はLinkから、数式はこっちでまとめていることが多い

【Redmine】Redmineインストール(Windows)

プロジェクト管理ツールのRedmineのインストール方法のメモ

Redmine:http://redmine.jp/

今回は、xampp(apacheMySQL)を用いてRedmineの起動を行った。

 

Rubyのインストール RubyInstallerを下記URLからダウンロードし、実行する。

http://rubyinstaller.org/

 

Railsのインストール 下記コマンドを実行する。

gem install rails –include-dependencies

 

Redmineを下記URLからダウンロードする。(redmine-1.2.1) http://rubyforge.org/frs/?group_id=1850

実際の中身はRuby on Railsアプリです。それっぽいディレクトリ構造でした。 これを展開し、Cドライブ直下に移動し、redmineに名前を変更する

今回は、MySQLRedmine用作成します。 データベース作成(文字コードの指定を忘れないように)

create database redmine character set utf8;

データベースの作成確認

show databases;

ユーザ作成

create user redmine@localhost identified by '任意のパスワード';

ユーザ確認

select host, user from mysql.user;

全権限付加

grant all privileges on redmine.* to redmine@localhost;

権限確認

show grants for redmine@localhost;

redmineユーザでログイン

mysql -u redmine -p

ログインユーザのステータス確認

status;

データベース設定ファイル変更

config/database.example.ymlをコピーし、 config/database.ymlを作成後、編集する。

production:

  adapter: mysql

  database: redmine

  host: localhost

  username: redmine

  password: 任意のパスワード

  encoding: utf8

 

Redmine用のテーブル作成(C:\redmine\db\migrateが実行されて作成される)

rake db:migrate RAILS_ENV="production"

エラー発生・・・下記インストールするように注意されたので実行。

gem install -v=0.4.2 i18n

 

再度実行「rake db:migrate RAILS_ENV="production"」 RackのVersionで怒られる

下記コマンドを実行し、特定バージョンを入手

gem install rack --version 1.1.1

 

MySQLのアダプタが無くて怒られる 下記コマンドを実行

gem install mysql

 

再度実行「rake db:migrate RAILS_ENV="production"」 Redmineデータベースにテーブルが作成される。

use redmine; show tables;で確認。

 

Redmineの起動

apacheMySQLを起動し、下記コマンドを実行。

C:\redmine>ruby script/server -e production

NOTE: SourceIndex.new(hash) is deprecated; From

C:/redmine/config/../vendos/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'. => Booting WEBrick => Rails 2.3.11 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2011-08-24 03:00:51] INFO WEBrick 1.3.1 [2011-08-24 03:00:51] INFO ruby 1.8.7 (2011-06-30) [i386-mingw32] [2011-08-24 03:00:51] INFO WEBrick::HTTPServer#start: pid=4776 port=3000

その後、http://localhost:3000/にアクセスする。

Redmineインストール完成です。

 

追記は、インストーラを使わなかった場合の失敗版をまとめたもの。

いつかインストーラを使わないときが来たときのために保存してあります。

Rubyのインストール Rubyhttp://www.ruby-lang.org/ja/

下記からRubyのZIPをダウンロードします。

http://www.garbagecollect.jp/ruby/mswin32/ja/download/release.html

ダウンロード後、展開し、Cドライブ直下にrubyという名前で移動します。 その後、binディレクトリにPATHを通します。 コマンドプロンプトで下記コマンドを実行し、バージョンが表示されればインストール完了です。

ruby -v ruby 1.9.2p136 (2010-12-25 revision 30365) [i386-mswin32] ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mswin32]

 

rubygemsのインストール ruby関連のソース・パッケージ管理ツール

http://rubyforge.org/frs/?group_id=126 下記URLからダウンロードし、展開後、下記コマンドを実行する。 ruby C:\rubygems-1.8.8\setup.rb コマンドプロンプトで下記コマンドを実行し、バージョンが表示されればインストール完了です。

gem -v 1.8.8

 

Ruby on Railsのインストール 下記コマンドを実行する。

gem install rails

するとエラーが発生しました。 zlib.dllが見つからなかったため、このアプリケーションを解しできませんでした。アプリケーションをインストールしなおすとこの問題は解決される場合があります。

ERROR: Loading command: install (LoadError) 126: 指定されたモジュールが見つかりません。 - C:/ruby/lib/ruby/1.8/i386-mswin32/zlib.so ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand

以下のURLからzlib compiled DLLをダウンロードします。

http://www.zlib.net/

展開して表示された「zlib1.dll」をrubyのパスを通したディレクトリに移動します。 その後、「zlib1.dll」に名前を変更します。

参考:http://www.rubylife.jp/railsinstall/rubygems/index3.html

 

再度、Railsをインストール

gem install rails

Fetching: activesupport-3.0.10.gem (100%) Fetching: builder-2.1.2.gem (100%) WARNING: builder-2.1.2 has an invalid nil value for @cert_chain Fetching: i18n-0.5.0.gem (100%) Fetching: activemodel-3.0.10.gem (100%) Fetching: rack-1.2.3.gem (100%) Fetching: rack-test-0.5.7.gem (100%) Fetching: rack-mount-0.6.14.gem (100%) Fetching: tzinfo-0.3.29.gem (100%) Fetching: abstract-1.0.0.gem (100%) WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain Fetching: erubis-2.6.6.gem (100%) Fetching: actionpack-3.0.10.gem (100%) Fetching: arel-2.0.10.gem (100%) Fetching: activerecord-3.0.10.gem (100%) Fetching: activeresource-3.0.10.gem (100%) Fetching: mime-types-1.16.gem (100%) Fetching: polyglot-0.3.2.gem (100%) Fetching: treetop-1.4.10.gem (100%) Fetching: mail-2.2.19.gem (100%) Fetching: actionmailer-3.0.10.gem (100%) Fetching: rake-0.9.2.gem (100%) Fetching: thor-0.14.6.gem (100%) Fetching: rdoc-3.9.2.gem (100%) Depending on your version of ruby, you may need to install ruby rdoc/ri data: <= 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! Fetching: railties-3.0.10.gem (100%) Fetching: bundler-1.0.18.gem (100%) Fetching: rails-3.0.10.gem (100%) Successfully installed activesupport-3.0.10 Successfully installed builder-2.1.2 Successfully installed i18n-0.5.0 Successfully installed activemodel-3.0.10 Successfully installed rack-1.2.3 Successfully installed rack-test-0.5.7 Successfully installed rack-mount-0.6.14 Successfully installed tzinfo-0.3.29 Successfully installed abstract-1.0.0 Successfully installed erubis-2.6.6 Successfully installed actionpack-3.0.10 Successfully installed arel-2.0.10 Successfully installed activerecord-3.0.10 Successfully installed activeresource-3.0.10 Successfully installed mime-types-1.16 Successfully installed polyglot-0.3.2 Successfully installed treetop-1.4.10 Successfully installed mail-2.2.19 Successfully installed actionmailer-3.0.10 Successfully installed rake-0.9.2 Successfully installed thor-0.14.6 Successfully installed rdoc-3.9.2 Successfully installed railties-3.0.10 Successfully installed bundler-1.0.18 Successfully installed rails-3.0.10 25 gems installed Installing ri documentation for activesupport-3.0.10... Installing ri documentation for builder-2.1.2... Installing ri documentation for i18n-0.5.0... Installing ri documentation for activemodel-3.0.10... Installing ri documentation for rack-1.2.3... Installing ri documentation for rack-test-0.5.7... Installing ri documentation for rack-mount-0.6.14... Installing ri documentation for tzinfo-0.3.29... Installing ri documentation for abstract-1.0.0... Installing ri documentation for erubis-2.6.6... Installing ri documentation for actionpack-3.0.10... Installing ri documentation for arel-2.0.10... Installing ri documentation for activerecord-3.0.10... ERROR: While generating documentation for activerecord-3.0.10 ... MESSAGE: Invalid argument - ./http://jarp.does.notwork.org/win32/

展開後、「readline.dll」をrubyのパスを通したディレクトリに移動します。

再度、

gem install rails -v=2.3.5 Successfully installed rails-2.3.5 1

gem installed Installing ri documentation for rails-2.3.5... Installing RDoc documentation for rails-2.3.5...

 

無事成功!下記コマンドで確認します。

rails -v Rails 3.0.10

 

Rackのインストール Rackについて:

http://route477.net/d/?date=20080716

gem install rack -v=1.0.1

Successfully installed rack-1.0.1 1

gem installed Installing ri documentation for rack-1.0.1... Installing RDoc documentation for rack-1.0.1...

 

Redmineのインストール

本文のRedmine部分参照

Redmine用データベースの作成

本文のMySQL部分参照

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

rake config/initializers/session_store.rb

 

下記エラーが発生したので、

Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`

下記コマンドを実行してインストール

gem install -v=0.4.2 i18n

Fetching: i18n-0.4.2.gem (100%) Successfully installed i18n-0.4.2 1 gem installed Installing ri documentation for i18n-0.4.2... Installing RDoc documentation for i18n-0.4.2...

 

再度「rake config/initializers/session_store.rb」を実行

下記エラーが発生 iconv.dllが見つからなかったため、このアプリケーションを解しできませんでした。アプリケーションをインストールしなおすとこの問題は解決される場合があります。

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. Gem.source_index called from C:/redmine/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21. NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01. Gem::SourceIndex#refresh! called from C:/redmine/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:34. NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01. Gem::SourceIndex#load_gems_in called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:322. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will beremoved on or after 2011-11-01. Gem::SourceIndex#initialize called from C:/redmine/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+) rake aborted! 126: 指定されたモジュールが見つかりません。 - C:/ruby/lib/ruby/1.8/i386-mswin3 2/iconv.so (See full trace by running task with --trace)

 

下記URLからreadline-4.3-2-mswin32.zipをダウンロードする。

http://www.meadowy.org/meadow/dists/snapshot/old/iconv-1.8.win32.zip

展開後、「iconv.dll」をrubyのパスを通したディレクトリに移動します。

参考:http://www.rubylife.jp/install/other/index1.html

また実行・・・下記が表示された

rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+) WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [args] => [deps]' instead. at C:/redmine/lib/tasks/email.rake:170 下記を実行 C:\redmine>rake db:migrate RAILS_ENV="production"

 

上記と同じような警告が表示された

rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+) WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [args] => [deps]' instead. at C:/redmine/lib/tasks/email.rake:170 rake aborted! undefined method `name' for "abstract":String Tasks: TOP => db:migrate => environment (See full trace by running task with --trace)

⇒gemが1.6系じゃないとだめらしいので、ダウングレード

gem update --system 1.6.2

A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb

⇒セッション用のシード?salt?ぽいのを設定するらしい

config.action_controller.session = { :key => "_myapp_session", :secret => "30文字の英数字"} これでmigrateできて、redmineも動きました。