redmine搭建好可以访问时,但是点注册和登录后点我的账号出现500错误

redmine搭建好可以访问时,但是点注册和登录后点我的账号出现500错误:

----------------------------------

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.

----------------------------------


解决方法如下,在redmine目录进行

cd/usr/local/redmine

vi app/helpers/application_helper.rb

找到以下的内容,进行相应的删除和添加

def lang_options_for_select(blank=true)

  #(blank ? [["(auto)", ""]] : []) + languages_options    //删除些行,也可以在前面加个“#”号注释

  (blank ? [["(auto)", ""]] : []) +      //添加此行

  valid_languages.collect{|lang| [ ll(lang.to_s, :general_lang_name),lang.to_s]}.sort{|x,y| x.last <=> y.last }    //添加此行

end


vi lib/redmine/i18n.rb

找到以下内容,并全体删除或注释掉也是可以的

   # Returns an array of languages names andcode sorted by names, example:

   # [["Deutsch", "de"],["English", "en"] ...]

   #

   # The result is cached to prevent fromloading all translations files.

  def languages_options

     ActionController::Base.cache_store.fetch"i18n/languages_options" do

       valid_languages.map {|lang|[ll(lang.to_s, :general_lang_name), lang.to_s]}.sort {|x,y| x.first <=>y.first }

   end

  end

vi test/unit/lib/redmine/i18n_test.rb

找到以下的内容,并全体删除或注释掉也是可以的

def test_languages_options

  options = languages_options


  assert options.is_a?(Array)

  assert_equal valid_languages.size, options.size

  assert_nil options.detect {|option| !option.is_a?(Array)}

  assert_nil options.detect {|option| option.size != 2}

  assert_nil options.detect {|option| !option.first.is_a?(String) ||!option.last.is_a?(String)}

  assert_include ["English", "en"], options

end

再重启apacheredmine服务碰运气,问题就全体解决了


你可能感兴趣的:(redmine,访问500错误)