ラベル Redmine の投稿を表示しています。 すべての投稿を表示
ラベル Redmine の投稿を表示しています。 すべての投稿を表示

2013年10月20日日曜日

Redmineの差分表示でエラーが出る問題の解決

RedmineでSubverionのリポジトリの差分を表示すると以下のエラーが出る原因の調査と対策。
まずはapacheのログを確認。
気になるログを発見。
# less /var/log/httpd-error.log
[App 1238 stderr] ActionView::Template::Error (Permission denied - /usr/local/www/redmine/tmp/cache/544)
どうやら、パーミッションがないためテンポラリファイルを作成できない様子。
ためしにパーミッションを変更。
# chown nobody cache
無事、差分が表示されるようになった。

Redmineでファイルを添付できるようにする

保存先のフォルダのパーミッションを変更する。
# cd /usr/local/www/redmine
# chown nobody files
「管理」->「情報」の画面で「ファイルリポジトリに書き込み可能」が有効になればOK。









参考サイト
http://d.hatena.ne.jp/deis/20101008/redmine_file_up






2013年10月19日土曜日

RedmineとSVNの連携に失敗する問題の解決

先日、RedmineとSubversionを連携させるようにした。
しかし、WebサーバPCを起動した直後は、RedmineからSVNのリポジトリが見えない現象が発生した。
手動でapacheを再起動するとリポジトリが見えるようになる。
とても不便なので原因を調査した。

まずはapacheのログを確認。
% less /var/log/httpd-error.log
[App 920 stderr] svn: not found
[App 920 stderr] svn: not found
[App 920 stderr] Error parsing svn output: undefined method `[]' for nil:NilClass
気になるログを発見。
コマンドが認識されていない様子。

ためしに、redmineのsvnコマンドの設定をフルパスに変えてみる。
# vi /usr/local/www/redmine/config/configuration.yml
scm_subversion_command:   /usr/local/bin/svn                        # (default: svn)
しかし現象は変わらず。
!
ここで、あることに気づく。
<設定ファイルの内容>
  # Examples:
  scm_subversion_command:   /usr/local/bin/svn                        # (default: svn)
  # scm_mercurial_command:  C:\Program Files\TortoiseHg\hg.exe        # (default: hg)
  # scm_git_command:        /usr/local/bin/git                        # (default: git)
  # scm_cvs_command:        cvs                                       # (default: cvs)
  # scm_bazaar_command:     bzr.exe                                   # (default: bzr)
  # scm_darcs_command:      darcs-1.0.9-i386-linux                    # (default: darcs)
  #
  scm_subversion_command:
  scm_mercurial_command:
  scm_git_command:
  scm_cvs_command:
  scm_bazaar_command:
  scm_darcs_command:
最初の設定時にExamplesをコメントアウトして編集したのがそもそもの間違い。
だめだめじゃないですか。。
気を取り直て再編集。
  # scm_subversion_command: svn                                       # (default: svn)
  # scm_mercurial_command:  C:\Program Files\TortoiseHg\hg.exe        # (default: hg)
  # scm_git_command:        /usr/local/bin/git                        # (default: git)
  # scm_cvs_command:        cvs                                       # (default: cvs)
  # scm_bazaar_command:     bzr.exe                                   # (default: bzr)
  # scm_darcs_command:      darcs-1.0.9-i386-linux                    # (default: darcs)
  #
  scm_subversion_command:   svn
  scm_mercurial_command:
  scm_git_command:
  scm_cvs_command:
  scm_bazaar_command:
  scm_darcs_command:
これで解決。。。かと思いきや現象は変わらず。
ログに同じエラーが出力される。
フルパス指定で再チャレンジ。
  scm_subversion_command:   /usr/local/bin/svn
今度はOK。

設定ファイル修正前に、apacheを再起動するとうまくいっていたのはなぜだろう。
謎は残ったがとりあえずよしとする。

2013年10月7日月曜日

Redmine Tips


  • ショートカットキー

Shift+Alt+E:チケットの編集

FreeBSDでRedmineを使うメモ

まずはパッケージからredmine-2.3.2をインストール
# pkg_add -r redmine
インストール完了
=============================================================================
Redmine was installed.
You now need to setup your Redmine installation so
please have a look at the Installation Guide.
http://www.redmine.org/wiki/redmine/RedmineInstall

If you are upgrading please read the Upgrading Guide
before starting the new version.
http://www.redmine.org/wiki/redmine/RedmineUpgrade
=============================================================================
参考サイトの日本語訳
http://redmine.jp/guide/RedmineInstall/
データベースはPostgreSQL8.4を使用する。
# pkg_add -r postgresql84-server
参考サイト
http://www.kishiro.com/FreeBSD/postgresql8.html
# su pgsql
$ cd /usr/local/pgsql/
$ mkdir data
$ initdb -D ./data --encoding=utf-8 --lc-collate=C
「rc.conf」の設定
postgresql_enable="YES"
postgresql_flags="-w -s -m fast"
postgresql_initdb_flags="--encoding=utf-8 --lc-collate=C"
postgresql_class="default" 
参考サイト(ROLEとは)
http://www.postgresql.jp/document/8.1/html/user-manag.html
データベース作成
$ createdb test_db
SQLコマンドプロンプト入力
$ psql test_db
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'my_password' NOINHERIT VALID UNTIL 'infinity';
CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
ユーザ「redmine」作成
# vipw
「config/database.yml」の編集
# cd /usr/local/www/redmine/config
# cp database.yml.example database.yml
production:
adapter: postgresql
database: redmine
host: localhost
username: redmine
password: <postgres_user_password>
encoding: utf8
# schema_search_path: <database_schema> (default - public)
 セッションストア秘密鍵の生成
# rake generate_secret_token
(in /usr/local/www/redmine)
Could not find gem 'pg (>= 0.11.0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
エラーになってしまった。
Redmineを実行するために必要なすべてのgemをインストールする。
# bundle install --without development test
無事「pg」がインストールされたので先ほどのコマンドを再実行。
# rake generate_secret_token
今度は成功。
データベース上にテーブルを作成
# cd /usr/local/www/redmine
# env RAILS_ENV=production rake db:migrate
デフォルトデータをデータベースに登録
# env RAILS_ENV=production rake redmine:load_default_data
Select languageでは「ja」を選択
パーミッションの設定
# mkdir public/plugin_assets
# chown -R redmine:pgsql files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
WEBrickによるwebサーバでの起動テスト
# ruby script/rails server webrick -e production