小编Pap*_*peh的帖子

tzinfo-data 存在但未见?

我正在学习 Rails 课程,并收到以下错误,告诉我安装 tzinfo-data gem。但是,gem 已安装。它在我的 gemfile 中。我可以在 Ruby 目录中找到该文件夹​​。为什么这仍然告诉我安装 tzinfo-data?

命令行响应和 gemfile 如下:

C:\Users\KevinLamb\Documents\sites\demo_project>rails db:schema:dump
rails aborted!
TZInfo::DataSourceNotFound: tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install
C:/Users/KevinLamb/Documents/sites/demo_project/config/environment.rb:5:in `<main>'

Caused by:
TZInfo::DataSources::ZoneinfoDirectoryNotFound: None of the paths included in TZInfo::DataSources::ZoneinfoDataSource.search_path are valid zoneinfo directories.
C:/Users/KevinLamb/Documents/sites/demo_project/config/environment.rb:5:in `<main>'
Tasks: TOP => db:schema:dump => db:load_config => environment
(See full trace by running task with --trace)
Run Code Online (Sandbox Code Playgroud)

我正在工作的 demo_project 目录中的 Gemfile:

source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby …
Run Code Online (Sandbox Code Playgroud)

ruby rubygems ruby-on-rails tzinfo ruby-on-rails-5

3
推荐指数
1
解决办法
1740
查看次数

标签 统计

ruby ×1

ruby-on-rails ×1

ruby-on-rails-5 ×1

rubygems ×1

tzinfo ×1