美文网首页
Rails on ruby笔记

Rails on ruby笔记

作者: 山椒魚半蔵 | 来源:发表于2022-09-09 21:22 被阅读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重启即可 

相关文章

网友评论

      本文标题:Rails on ruby笔记

      本文链接:https://www.haomeiwen.com/subject/ttwcattx.html