This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

Pages

2012年1月14日土曜日

redmineで悪戦苦闘

redmineのメールリマインダ機能を活用する為にいろいろいじっているんだが、
エラーが出て上手く動かない。
手動では動作するのに、cronに設定すると上手くいかない。

エラーはこんな感じ。

rake aborted!
undefined method `requirement' for #<Rails::GemDependency:0xb7c31ad8>


うーん、なんでだろう。
ひとまず、バージョン等を公式にあるものとあわせてみよう

Redmineのインストール
http://redmine.jp/guide/RedmineInstall/



Redmineのバージョン Ruby Rails Rack
1.3.x ruby 1.8.6, 1.8.7 Rails 2.3.14 Rack 1.1.1
1.2.x ruby 1.8.6, 1.8.7 Rails 2.3.11 Rack 1.1.1
1.1.x ruby 1.8.6, 1.8.7 Rails 2.3.5 Rack 1.0.1
1.0.x ruby 1.8.6, 1.8.7 Rails 2.3.5 Rack 1.0.1
0.9.x ruby 1.8.6, 1.8.7 Rails 2.3.5 Rack 1.0.1
0.8.x ruby 1.8.6, 1.8.7 Rails 2.1.2


とりあえず、最新版の1.3.0にするとして、
rubyは


$ ruby --version
ruby 1.8.7 (2011-12-28 MBARI 8/0x8770 on patchlevel 357) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2011.12

後ろにごちゃごちゃついているけど、とりあえずバージョンはあってるな。

次はRails

$ rails --version
Rails 3.1.3

うん、全然違う。

$ gem list

rails (3.1.3, 2.3.8)

とりあえず、消してしまおう。そして新しく入れよう

$ gem uninstall rails

Select gem to uninstall:
 1. rails-2.3.8
 2. rails-3.1.3
 3. All versions
> 3
Successfully uninstalled rails-2.3.8
Successfully uninstalled rails-3.1.3

$ gem install rails -y -v 2.3.14

INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
Fetching: activesupport-2.3.14.gem (100%)
Fetching: activerecord-2.3.14.gem (100%)
Fetching: actionpack-2.3.14.gem (100%)
Fetching: actionmailer-2.3.14.gem (100%)
Fetching: activeresource-2.3.14.gem (100%)
Fetching: rails-2.3.14.gem (100%)
Successfully installed activesupport-2.3.14
Successfully installed activerecord-2.3.14
Successfully installed actionpack-2.3.14
Successfully installed actionmailer-2.3.14
Successfully installed activeresource-2.3.14
Successfully installed rails-2.3.14
6 gems installed
Installing ri documentation for activesupport-2.3.14...
Installing ri documentation for activerecord-2.3.14...
Installing ri documentation for actionpack-2.3.14...
Installing ri documentation for actionmailer-2.3.14...
Installing ri documentation for activeresource-2.3.14...
Installing ri documentation for rails-2.3.14...
Installing RDoc documentation for activesupport-2.3.14...
Installing RDoc documentation for activerecord-2.3.14...
Installing RDoc documentation for actionpack-2.3.14...
Installing RDoc documentation for actionmailer-2.3.14...
Installing RDoc documentation for activeresource-2.3.14...
Installing RDoc documentation for rails-2.3.14...

どうやら入ったっぽい。

次はRack 何だろ、これ

下記サイトによると、サーバーとフレームワーク、アプリケーションの仲立ちをするような機能のようですね。
http://gihyo.jp/dev/serial/01/ruby/0023

とりあえず指定のバージョンをインストール
$ gem install rack -v=1.1.1

また、gemに関しても、
Rails 2.3.11(Redmine 1.2で必要)はRubyGems 1.7.0以降がインストールされていると利用できません。それより古いバージョンのRubyGemsを使用してください。
との事。

$ gem -v
1.5.3

これは大丈夫そうなんで、そのままでいいか。

そして、再起動。

・・
・・・
まったくお変りにならないエラーメッセージ。

その後、あれやこれやと試してみて
結局cronのPATHの問題でした。

手動でやったら動いて、cronに設定したら動かない。
普通に考えたら、そうよね。

とりあえず、エラーになったときに、
エラーメッセージをgoogleで検索⇒出てきた情報を一個ずつ試す
という事をやる前に、自分の頭で考えましょうという事。。