2007年8月12日日曜日

redMine カレンダーでエラー

■環境
Windows One-Click Ruby Installer を利用
http://rubyforge.org/projects/rubyinstaller/
(Rails 1.2.3)

mysql-5.0.45-win32
mongrel 1.0.1 (mswin32)
redmine-0.5.1

■エラー
(操作)
カレンダーやガントチャートを表示しようとするとエラー

(ブラウザの表示)
 Status: 500 Internal Server Error Content-Type: text/html

Internal error

An error occurred on the page you were trying to access.
If you continue to experience problems please contact your redMine administrator for assistance.

(コマンドプロンプト)

#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb:36:in `to_default_s'
#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb:43:in `to_default_s'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/array/conversions.rb:43:in `to_s'
#{RAILS_ROOT}/vendor/plugins/gloc-1.1.0/lib/gloc-rails-text.rb:129:in `select_html'
#{RAILS_ROOT}/vendor/plugins/gloc-1.1.0/lib/gloc-rails-text.rb:94:in `select_month'
#{RAILS_ROOT}/app/views/projects/calendar.rhtml:14:in `_run_rhtml_47app47views47projects47calendar46rhtml'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:108:in `call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:108:in `capture_erb_with_buffer'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb:67:in `capture'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb:51:in `form_tag'
#{RAILS_ROOT}/app/views/projects/calendar.rhtml:4:in `_run_rhtml_47app47views47projects47calendar46rhtml'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/caching.rb:331:in `call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/caching.rb:331:in `cache_erb_fragment'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/helpers/cache_helper.rb:6:in `cache'
#{RAILS_ROOT}/app/views/projects/calendar.rhtml:1:in `_run_rhtml_47app47views47projects47calendar46rhtml'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in `send'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:326:in `compile_and_render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:301:in `render_template'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_view/base.rb:260:in `render_file'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:806:in `render_file'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:711:in `render_with_no_layout'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/layout.rb:247:in `render_without_benchmark'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in `render'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in `render'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:1096:in `perform_action_without_filters'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:632:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:634:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in `call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in `call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in `call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:638:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:438:in `call'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:637:in `call_filter'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:619:in `perform_action_without_benchmark'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'
c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in `perform_action'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:430:in `send'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:430:in `process_without_filters'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/filters.rb:624:in `process_without_session_management_support'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in `process'
#{RAILS_ROOT}/vendor/rails/actionpack/lib/action_controller/base.rb:330:in `process'
#{RAILS_ROOT}/vendor/rails/railties/lib/dispatcher.rb:41:in `dispatch'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/rails.rb:78:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/rails.rb:76:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/rails.rb:76:in `process'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:618:in `process_client'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:617:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:617:in `process_client'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:736:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:736:in `initialize'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:736:in `new'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:736:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:720:in `initialize'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:720:in `new'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel.rb:720:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/configurator.rb:271:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/configurator.rb:270:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/configurator.rb:270:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:127:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/mongrel/command.rb:211:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/mongrel_rails:243
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load'
#{RAILS_ROOT}/vendor/rails/railties/lib/commands/servers/mongrel.rb:60
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
#{RAILS_ROOT}/vendor/rails/railties/lib/commands/server.rb:39
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3
by/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3

■調査
gloc-rails-text.rb:129:in `select_html'の所は、
select_html << options.to_s
と言うコードで、HTMLのSELECTタグを作っている所、
ここをコメントアウトするとエラーは止まる。
画面が表示されるが、SELECTのプルダウンが空となる。
となると、to_sが怪しい。

よく見ると、active_supportが2重に有効になっている。
#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb:36:in `to_default_s'
#{RAILS_ROOT}/vendor/rails/activesupport/lib/active_support/core_ext/array/conversions.rb:43:in `to_default_s'
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/array/conversions.rb:43:in `to_s'

たしかに私の環境は、Windows One-Click Ruby Installerなので、
Railsのセットは既に入っている。

redMineのconfig/boot.rbに、
こんな行があるので、私の環境の場合2重に起動した訳です。
if File.directory?("#{RAILS_ROOT}/vendor/rails")
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"

■対策
 ソースは弄らずに、redMineのインストールディレクトリ配下に入っている
 /vendor/railsのrailsディレクトリをralis_noneedに変えました。

■結果
 カレンダーが正しく表示される様になりました。
 もちろんSELECTタグのプルダウンには月が
 ちゃんと入っています。

1 件のコメント:

匿名 さんのコメント...

たいへん役に立ちました。
ありがとうございまいした。