博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
window下rails4.1 发生TZInfo::DataSourceNotFound 错误 - smallbottle
阅读量:4342 次
发布时间:2019-06-07

本文共 1064 字,大约阅读时间需要 3 分钟。

在官网上学习rails 4.1 ,启动rails server之后发生了如下错误

$ rails server

Booting WEBrick
Rails 4.1.0 application starting in development on ....
Exiting
c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/data_source.rb:199:
in `rescue in create_default_data_source':
No timezone data source could be found. To resolve this, either install
TZInfo::Data (e.g. by running `gem install tzinfo-data`) or specify a zoneinfo
directory using `TZInfo::DataSource.set(:zoneinfo, zoneinfo_path)`.
(TZInfo::DataSourceNotFound)
from c:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/tzinfo-1.1.0/lib/tzinfo/data_source.rb:196:
in `create_default_data_source'

给出了解决方法,安装tzinfo-data,在运行命令gem install tzinfo-data之后,还是这个错误。

原因是因为64位操作系统,打开创建的rails应用下的gemfile文件,

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

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

然后运行bundle update,即可。

参考:http://stackoverflow.com/questions/23022258/tzinfodatasourcenotfound-error-starting-rails-v4-1-0-server-on-windows

转载于:https://www.cnblogs.com/chenjianhong/p/4144413.html

你可能感兴趣的文章
【转】how can i build fast
查看>>
null?对象?异常?到底应该如何返回错误信息
查看>>
django登录验证码操作
查看>>
(简单)华为Nova青春 WAS-AL00的USB调试模式在哪里开启的流程
查看>>
图论知识,博客
查看>>
[原创]一篇无关技术的小日记(仅作暂存)
查看>>
20145303刘俊谦 Exp7 网络欺诈技术防范
查看>>
原生和jQuery的ajax用法
查看>>
iOS开发播放文本
查看>>
20145202马超《java》实验5
查看>>
JQuery 事件
查看>>
main(argc,argv[])
查看>>
第四阶段 15_Linux tomcat安装与配置
查看>>
NAS 创建大文件
查看>>
学习笔记-模块之xml文件处理
查看>>
接口测试用例
查看>>
Sybase IQ导出文件的几种方式
查看>>
案例:手动输入一个字符串,打散放进一个列表,小写字母反序 大写字母保持不变...
查看>>
linux 系统下 tar 的压缩与解压缩命令
查看>>
阿里负载均衡,配置中间证书问题(在starcom申请免费DV ssl)
查看>>