Chandrahas Reddy ha scritto:

HI i am new to ruby rails . I downloaded the project RCMS-0.3.1 and
began working on it. I am getting the error like

undefined method `init_gettext' for ApplicationController:Class

And the application contoller is somewhat like ths. Some one plz help

require_dependency 'login_system'
require 'rcms'
require 'gettext'

GetText.output_charset = "UTF-8"

class ApplicationController < ActionController::Base
  include LoginSystem
  model :user
  model :role
  model :rcms_log
  model :component_config
  model :channel
  # ferret!
  model :result

  before_filter :crumps
  cattr_accessor :rlogger


  @@rlogger = Logger.new("#{RAILS_ROOT}/log/rcms.log")
  @@rlogger.level = Logger::DEBUG

  init_gettext "rcms"
  #def init_gettext
  # "rcms"
    # The locale is set automatically or uses Cookie value, parameter
    #bindtextdomain("rcms", request.cgi, RcmsConfig.instance.site_lang)
  # @headers["Content-Type"] = "text/html; charset=UTF-8"

  def crumps
    arr = request.env_table['REQUEST_URI'].sub(
/(http:\/\/[^\/]*){0,1}\/(.*)/, '\2' ).sub( /([^?]*)\?.*$/, '\1'
    @crumps = ""
    tmp = ""
    for word in arr
      unless word =~ /\.html/
        tmp << "/" << word
        @crumps << "<a href=\"" + tmp + "\">" + word.gsub(/_/,' ') +
    # this is damn dirty... :wink:

  def dblog(msg,level)
    ip = @request.env_table['REMOTE_ADDR']
    user = @session[:user]
      Rcms::DbLog.log({:ip => @request.env_table['REMOTE_ADDR'],
                      :message => msg,
                      :level => level,
                      :user => @session[:user] } )
    rescue Exception => e
      logger.warn "application - controller caught logexception...#{e}"


I don't know RCMS project but I think you must install gettext (gem install gettext)

Good luck !