zoukankan      html  css  js  c++  java
  • window下rails4.1 发生TZInfo::DataSourceNotFound 错误

    在官网上学习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

  • 相关阅读:
    电力基本知识
    .net图表工具汇总
    最重要的十年做什么才不浪费?
    花10分钟看一看少走30年弯路
    给明年依然年轻的我们
    Qt经典—线程、事件与Qobject
    C#源码500份
    .NET 性能优化方法总结==转
    qt +ChartDirector 绘制图表
    创业者,你为什么这么着急?
  • 原文地址:https://www.cnblogs.com/chenjianhong/p/4144414.html
Copyright © 2011-2022 走看看