4

嗨,当我尝试运行时rails server,它只是退出并显示以下消息:

C:\rails_project\first_app>rails s
=> Booting WEBrick
=> Rails 4.1.0 application starting in development on http0 0 0 0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0 0 0 0). Consider using 127.0
.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/data_source.rb:1
99:in `rescue in create_default_data_source': No timezone data source could be f
ound. To resolve this, either install TZInfo::Data (e.g. by running `gem install
 tzinfo-data`) or specify a zoneinfo directory using `TZInfo::DataSource.set(:zo
neinfo, zoneinfo_path)`. (TZInfo::DataSourceNotFound)

有人可以让我知道我错过了什么吗?

4

3 回答 3

9

我不知道您是否仍然遇到这个问题,我一直在为同样的问题而苦苦挣扎,直到几周后我终于解决了。这是 x64 机器的问题。

只需转到您的 gemfile 并搜索gem 'tzinfo-data'

然后在数组中添加这个:x64_mingw

它必须看起来像这样

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

然后保存,进行捆绑更新,然后捆绑安装,幸运的是您的 Rails 服务器将启动。

于 2014-05-22T20:59:36.897 回答
2

听起来你需要:

gem install tzinfo

我的机器上安装了 tzinfo 1.1.0。

您可能需要的另一个软件包是:

gem install tzinfo-data

请务必将其添加到您的 Gemfile 中:

gem 'tzinfo-data', '1.2014.5'
于 2014-04-12T17:24:19.403 回答
1

仅供参考,您遇到的错误可能取决于您config.time_zone在应用程序中的使用。错误是说要解释正确的时区,它需要使用tzinfo依赖项

于 2014-04-13T09:08:10.320 回答