Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
"The dependency tzinfo-data will be unused" on Ubuntu #12
When I run "rails new appname" command I get this message
but it didn't help.
The warning message is coming from Bundler (rubygems/bundler#5003). It is not an error and can be ignored.
When you create a new Ruby on Rails application, a
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
The purpose of this line is to include the tzinfo-data gem in the bundle on Windows to act as a source of time zone data. This gem is unnecessary on Ubuntu (and Unix-based systems in general) because the system includes time zone data that can be read directly by tzinfo.
If you want to get rid of the warning message you can do one of the following:
Each of these options would need to be carried out for each Rails application you create.
You can also run
Thank you philr, I was wondering( and I am a new to programming) how did you learn that? I see lots off folks know great things (like you in this post), but how did you acquire that knowledge? I hope to learn how to learn when it comes to programming. Any advice would be greatly appreciated.
I read philir's answer, and thank you. It is nice to know that it is not an error message, but I am no longer able to (I am sorry if this is worded badly) program in the terminal anymore. My username and the '$' and the name of the directory I am in do not show up. I can type in the line and hit enter, but it is more like I am writing a paper now. No program is executing. I have tried exiting and reopening the terminal and running the program again, but it is always the same output.
I closed and reopened the terminal. This time I did not get the notification at the end when the program executed, but I still am having the typing issue.
Just adding that an additional way to silence this warning is by enabling the
bundle config --local disable_platform_warnings true
This will silence any platform warnings in the context of the current app. If you leave off the
Rails includes this gem for Windows platforms that don't come bundled with zoneinfo files. Unfortunately, on non-Windows platforms Bundler tries to be helpful and issues a warning on every run of `bundle install` alerting you that this dependency has been skipped: >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`. This can be safely ignored as it is intentional to skip this dependency on unix-like platforms where zoneinfo files are provided by the system. See: tzinfo/tzinfo-data#12 (comment) Fortunately, Bundler has a [configuration option](https://bundler.io/v1.17/bundle_config.html) `disable_platform_warnings` for silencing this specific warning. Given that it's unlikely I'll add any additional platform-specific dependencies to this project and it's annoying to see this warning every time I run `bundle install`, I've opted to turn this on for this app specifically by running `bundle config --local disable_platform_warnings true` (using `--local` to store the option in this app's `.bundle/config` rather than globally on this machine since I *would* want to be warned in other apps). Since Rails by default ignores the `.bundle` directory (for [good reason](https://stackoverflow.com/questions/6963496/why-does-rails-ignore-bundle-by-default)), every developer using a unix-like environment needs to run this command themselves after cloning, which this commit notes in the README.md.
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] The purpose of this line is to include the tzinfo-data gem in the bundle on Windows to act as a source of time zone data. This gem is unnecessary on Ubuntu (and Unix-based systems in general) because the system includes time zone data that can be read directly by tzinfo. Source: tzinfo/tzinfo-data#12 (comment)