Rails on ruby笔记

2022-09-09  本文已影响0人  山椒魚半蔵

创建新项目:

rails new blog

报错:rails aborted! TZInfo::DataSourceNotFound: tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install

解决办法一:

1. 在Gemfile文件中添加 gem 'tzinfo-data' 

2. bundle install

3. rails s重启即可 

解决办法二:

1. 还一种可能是rails默认在Gemfile生成的是"gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]",此时只需要保留gem 'tzinfo-data' ,后面的platforms: [:mingw, :mswin, :x64_mingw, :jruby]"删掉

2. bundle update

3. rails s重启即可 

上一篇 下一篇

猜你喜欢

热点阅读