【问题标题】:ruby on rails server not starting [duplicate]rails服务器上的ruby没有启动[重复]
【发布时间】:2014-04-12 17:14:15
【问题描述】:

嗨,当我尝试运行 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)

有人可以告诉我我缺少什么吗?

【问题讨论】:

  • 您是否运行bundle install 来安装所有需要的gem?也许gem install tzinfo-data需要在windows上手动完成?
  • DL 已弃用,请使用 Fiddle 从rubygems.org 获取gem 元数据............从rubygems.org 获取其他元数据.. 解决依赖关系...使用rake 10.2。 2 使用 i18n 0.6.9 使用 json 1.8.1 使用 minitest 5.3.2 使用 thread_safe 0.3.3
  • 使用mime-types 1.25.1 使用polyglot 0.3.4 使用treetop 1.4.15 使用mail 2.5.4 使用actionmailer 4.1.0 使用activemodel 4.1.0 使用arel 5.0.0 使用activerecord 4.1.0使用bundler 1.6.1 使用coffee-script-source 1.7.0 使用execjs 2.0.2 使用coffee-script 2.2.0 使用thor 0.19.1 使用railties 4.1.0 使用coffee-rails 4.0.1 使用hiking 1.2.3 使用multi_json 1.9.2 使用jbuilder 2.0.6 使用jquery-rails 3.1.0 使用tilt 1.4.1 使用sprockets 2.11.0 使用sprockets-rails 2.1.3 使用rails 4.1.0 使用rdoc 4.1.1 使用sass 3.2.19 使用sass- rails 4.0.3 使用 sdoc 0.4.0
  • 使用 sqlite3 1.3.9 使用 turbolinks 2.2.2 使用 uglifier 2.5.0 您的包已更新! C:\rails_project\first_app>
  • 感谢您的建议。我刚刚删除了我之前安装的 ruby​​ on rails 并重新安装它现在可以工作了。

标签: ruby-on-rails tzinfo


【解决方案1】:

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

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

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

一定是这样的

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

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

【讨论】:

  • 是的!你就是那个男人!一开始我错过了bundle updatebundle install,这是必要的。
【解决方案2】:

听起来你需要:

gem install tzinfo

我的机器上安装了 tzinfo 1.1.0。

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

gem install tzinfo-data

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

gem 'tzinfo-data', '1.2014.5'

【讨论】:

  • 我已经安装了 tzinfo 并且做了捆绑更新和捆绑安装
  • 如果你添加到你的 Gemfile 中它可以工作:gem 'tzinfo-data', '1.2014.5' 但是如果你想要未来的更新,你应该尝试:gem 'tzinfo-data'
【解决方案3】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-09-02
    • 2017-01-23
    • 1970-01-01
    • 2012-12-12
    • 2011-03-11
    • 2013-05-31
    • 1970-01-01
    • 2019-07-25
    相关资源
    最近更新 更多