Trying to learn ruby on rails and I keep coming up with this error:
rails aborted!
TZInfo::DataSourceNotFound: tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install
Caused by:
TZInfo::DataSources::ZoneinfoDirectoryNotFound: None of the paths included in TZInfo::DataSources::ZoneinfoDataSource.search_path are valid zoneinfo directories.
D:/RubyRails/ineedhelp/config/environment.rb:5:in `<main>'
Tasks: TOP => app:template => environment
(See full trace by running task with --trace)
rails turbo:install stimulus:install
You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem.
You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem.
when I'm starting a new project
I'm using Windows 10 64bit.
Though I keep adding gem "tzinfo-data"
to my application's GemFile AND use gem install tzinfo
in cmd, it doesn't work.
It may work temporarily but the error keeps showing up each time I'm trying to insert another command in cmd (like rails s
).
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
This line is already in my GemFile when the error pops up. I already tried several solutions found online.
Just remove the platform part This is how your gem name should look like