Ruby on rails TZInfo::带有rails 3.1.0和ubuntu的InvalidTimezoneIdentifier

Ruby on rails TZInfo::带有rails 3.1.0和ubuntu的InvalidTimezoneIdentifier,ruby-on-rails,ubuntu,ruby-on-rails-3.1,Ruby On Rails,Ubuntu,Ruby On Rails 3.1,以下是与服务器建立初始http连接时日志文件中的错误。奇怪的是,有时服务器可以毫无问题地呈现http连接。但更常见的是TZinfo错误 Started GET "/" for 98.206.231.173 at 2011-11-13 09:41:34 +0800 Processing by SessionsController#new as HTML Rendered sessions/new.html.erb within layouts/sessions (2.2ms) Complete

以下是与服务器建立初始http连接时日志文件中的错误。奇怪的是,有时服务器可以毫无问题地呈现http连接。但更常见的是TZinfo错误

Started GET "/" for 98.206.231.173 at 2011-11-13 09:41:34 +0800
  Processing by SessionsController#new as HTML
Rendered sessions/new.html.erb within layouts/sessions (2.2ms)
Completed 200 OK in 4ms (Views: 3.4ms | ActiveRecord: 0.0ms)

TZInfo::InvalidTimezoneIdentifier (no such file to load -- tzinfo/definitions/Etc/UTC):

有什么建议可以解决吗?谢谢。

您如何为Rails应用程序提供服务?杂种独角兽能否重新启动应用程序,以确保所有线程具有相同的配置

您的Gemfile中是否列出了“tzinfo”作为依赖项

您使用的是哪个版本的TZinfo?能否尝试将TZInfo更新到最新版本? e、 g.运行
bundle更新

所有较新版本的TZInfo,如0.3.30,都有目录
lib/TZInfo/definitions/Etc
,其中包含
UTC.rb
定义,如下所示:

$ more .rvm/gems/ruby-1.9.2-p0/gems/tzinfo-0.3.30/lib/tzinfo/definitions/Etc/UTC.rb 
module TZInfo
  module Definitions
    module Etc
      module UTC
        include TimezoneDefinition

        timezone 'Etc/UTC' do |tz|
          tz.offset :o0, 0, 0, :UTC

        end
      end
    end
  end
end
您在
.rvm/gems/RUBY-VERSION/gems/
目录下看到了什么?您使用的是哪种TZInfo?UTC.rb文件在那里吗?目录和文件的权限是否为“世界可读”

可能与此有关:


选择时区中的另一个城市后,问题似乎消失了。tzinfo是0.3.30和0.3.29hmm。。。真奇怪。。如果将系统更改回UTC,并确保重新启动所有服务/进程,会发生什么情况?它重新出现了吗?你确定所有的gems在生产中的安装方式与在开发中的安装方式相同吗?e、 g.比较您的
Gemfile.lock
文件,以及托管应用程序代码和gem代码的目录上的用户/权限