rails:1783
From: "UEDA Hiroyuki" <bsdmad@g...>
Date: Thu, 2 Nov 2006 10:37:55 +0900
Subject: [rails:1783] Re: gettext のエラー
うえだ と申します。2ヶ月ほど前に質問させていただいた gettext のエラーの
件なのですが、未だに解決できておりません。
症状としては「undefined method `gettext' for ...」というアプリケーション
エラーが出るものの、再現性が無い、というものです。エラーメッセージは
以下のようなものになります。
---------------------------------------------------------------------------------
A ActionView::TemplateError occurred in bd_task#show:
undefined method `gettext' for 161824791:Fixnum
On line #18 of app/views/bd_task/_show2.rhtml
15: <p><label for="mini_task_content"><%= _('MiniTask|Content') %></label>
16: <pre><%=h @mini_task.content %></pre></p>
17:
18: <p><label for="mini_task_note"><%= _('MiniTask|Note') %></label>
19: <pre><%=h @mini_task.note %></pre></p>
20:
21: <%- if @mini_task.status != 0 -%>
---------------------------------------------------------------------------------
場所やテンプレートは違うのですが、チョコチョコと undefined method `gettext' for ...
が出るので、ユーザにはその度にリロードして誤魔化してもらっています。スッキリしたい
のですが、どなたかご助言いただけませんでしょうか。
rails の環境は以下の通りです。
---------------------------------------------------------------------------------
About your application's environment
Ruby version 1.8.4 (i686-linux)
RubyGems version 0.9.0
Rails version 1.1.6
Active Record version 1.14.4
Action Pack version 1.12.5
Action Web Service version 1.1.6
Action Mailer version 1.2.5
Active Support version 1.3.1
Application root /work2/Dr.WEB/rails/MiniTaskManager
Environment development
Database adapter sqlite3
GetText version 1.8.0
---------------------------------------------------------------------------------
また gettext に関しては config/environment.rb の末尾で require 'gettext/rails' と
しています。
---------------------------------------------------------------------------------
# Be sure to restart your web server when you modify this file.
$KCODE='u'
require 'jcode'
# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '1.1.6'
(省略)
ExceptionNotifier.exception_recipients = %w(bsdmad@g...)
ExceptionNotifier.sender_address = %("Application Error" <bsdmad@g...>)
ExceptionNotifier.email_prefix = "[MiniTaskManager] "
require 'gettext/rails'
---------------------------------------------------------------------------------
init_gettext に関しては app/controllers/application.rb に以下のように記載しています。
---------------------------------------------------------------------------------
# Filters added to this controller will be run for all controllers in
the application.
# Likewise, all the methods added will be available for all controllers.
require 'login_engine'
class ApplicationController < ActionController::Base
include LoginEngine
helper :user
model :user
include BrowserFilters
include ExceptionNotifiable
init_gettext 'bd'
before_filter :login_required
before_filter do |c|
User.current_user = User.find(c.session[:user].id) unless
c.session[:user].nil?
end
end
---------------------------------------------------------------------------------
以上、よろしくお願い致します。
--
UEDA "BSD mad" Hiroyuki <bsdmad@g...>
--
ML: rails@r...
使い方: http://QuickML.com/
1588 2006-08-31 02:51 [bsdmad@g... ] gettext のエラー 1606 2006-09-03 10:44 ┗[maki@r... ] 1609 2006-09-05 06:07 ┗[bsdmad@g... ] -> 1783 2006-11-02 02:37 ┗[bsdmad@g... ]