-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"The dependency tzinfo-data will be unused" on Ubuntu #12
Comments
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 |
It's good to know that this is not an error, thanks for help. |
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. |
@cronwel I'm the author of tzinfo and tzinfo-data, so that's why I know how they can be used. The |
* Don't need tzinfo-data since we don't use Windows: tzinfo/tzinfo-data#12 (comment)
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. update 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. |
I have the pros too, I dont know how to fix it . so sad ... |
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.
bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java tzinfo/tzinfo-data#12
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)
This gem is only relevant on windows: tzinfo/tzinfo-data#12
I was tired of seeing the output about the tzinfo-data file that is required by Windows in my bundler output. Turns out there's an easy way to disable it `bundle config disable_platform_warnings true` from tzinfo/tzinfo-data#12 (comment)
…will no longer run on Windows (probably acceptable if move to Docker for development). See tzinfo/tzinfo-data#12
When I run "rails new appname" command I get this message
I've tried
gem install tzinfo-data
but it didn't help.
I've also tried
bundle lock --add-platform mingw, mswin, x64_mingw, jruby
as the message suggested but it only works for particular app and every time I create a new app I see the message again.Ubuntu 14.04,
Ruby 2.3.3, Rails 5.0.1
The text was updated successfully, but these errors were encountered: