2

I'm a total newbie learning Ruby on Rails and using a Windows machine. The steps used to install ruby on rails were:

  1. download ruby200-x64 installer for Windows
  2. then run the following commands

    • ruby dk.rb init
    • ruby dk.rb install
    • gem install bundler
    • gem install sqlite3
    • gem install rails
    • rails new testapp
    • cd testapp
    • bundle exec rails server which means that I ran rails server in the testapp folder and part of the output says this:

      • Booting WEBrick
      • Rails 4.1.1 application starting in development on 0.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
      • Ctrl-C to shutdown server
      • Exiting
      • C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/tzinfo-1.2.1/lib/tzinfo/data_source.rb: No source of timezone data could be found. Please refer to http://tzinfo.github.io/datasourcenotfound for help resolving this error
      • Follow by more lines of codes (sorry, didn't have enough reputation points to post an image.
  3. Finally when I tried to connect to localhost:3000, 127.0.0.1:3000, or 0.0.0.0:3000. None worked. Any ideas? I'm guessing it has to do something with the Exiting line.

4

1 回答 1

0

该错误表明 TZInfo 无法在您的系统上找到时区数据源。如果您使用的是 Windows,这通常会发生。

解决 TZInfo::DataSourceNotFound 错误

尝试通过编辑Gemfile并放置gem 'tzinfo-data'并运行来安装 tzinfo-data gembundle install

或者使用 ruby​​ 模块作为数据源,运行

gem install tzinfo-data

于 2014-06-05T04:02:22.187 回答