TIL: How to remove “dependency tzinfo-data” warning when running ruby application

I recently took my first steps into ruby and rails. Both in terms of a new work, but also to learn new languages, syntax and concepts.

Setting up a new rails project and starting it either with rails c (for the console) or rails s for the built-in webserver, printed the following information

The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.

How to remove it?

A new project creates a Gemfile for defining dependencies. One of the lines look like this

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

Updating the line to only contain the gem name (tzinfo-data) removes the platform information/error-looking-helpful-message first shown in this post.

So, the new line should look like this

gem 'tzinfo-data'

Run bundle update after you updated yoru Gemfil