"The dependency tzinfo-data will be unused" on Ubuntu #12

Closed
terracotta210 opened this Issue Feb 13, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@terracotta210

terracotta210 commented Feb 13, 2017

When I run "rails new appname" command I get this message

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 mingw, mswin, x64_mingw, jruby.

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

@philr

This comment has been minimized.

Show comment
Hide comment
@philr

philr Feb 13, 2017

Member

The message is coming from Bundler (bundler/bundler#5003). It is not an error and can be ignored.

When you create a new Ruby on Rails application, a Gemfile is created including the following line that triggers the message:

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 message you can do one of the following:

  1. Remove the platforms option from the gem 'tzinfo-data' line in the Gemfile (and run bundle update). This will cause tzinfo to use tzinfo-data as its data source on all platforms instead of using the system time zone data.
  2. Remove the gem 'tzinfo-data' line from the Gemfile. This will cause tzinfo to always try and use the system time zone data. A TZInfo::DataSourceNotFound exception will be raised if you try and run your app on Windows.
  3. Run bundle lock --add-platform mingw, mswin, x64_mingw, jruby to add mingw, mswin, x64_mingw, and jruby to the list of platforms Bundler will include in the bundle.

Each of these options would need to be carried out for each Rails application you create.

Member

philr commented Feb 13, 2017

The message is coming from Bundler (bundler/bundler#5003). It is not an error and can be ignored.

When you create a new Ruby on Rails application, a Gemfile is created including the following line that triggers the message:

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 message you can do one of the following:

  1. Remove the platforms option from the gem 'tzinfo-data' line in the Gemfile (and run bundle update). This will cause tzinfo to use tzinfo-data as its data source on all platforms instead of using the system time zone data.
  2. Remove the gem 'tzinfo-data' line from the Gemfile. This will cause tzinfo to always try and use the system time zone data. A TZInfo::DataSourceNotFound exception will be raised if you try and run your app on Windows.
  3. Run bundle lock --add-platform mingw, mswin, x64_mingw, jruby to add mingw, mswin, x64_mingw, and jruby to the list of platforms Bundler will include in the bundle.

Each of these options would need to be carried out for each Rails application you create.

@philr philr closed this Feb 13, 2017

@terracotta210

This comment has been minimized.

Show comment
Hide comment
@terracotta210

terracotta210 Feb 14, 2017

It's good to know that this is not an error, thanks for help.

It's good to know that this is not an error, thanks for help.

@cronwel

This comment has been minimized.

Show comment
Hide comment
@cronwel

cronwel Jul 25, 2017

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 commented Jul 25, 2017

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.

@philr

This comment has been minimized.

Show comment
Hide comment
@philr

philr Jul 26, 2017

Member

@cronwel I'm the author of tzinfo and tzinfo-data, so that's why I know how they can be used. The Gemfile syntax and bundler command are documented on the Bundler documentation site.

Member

philr commented Jul 26, 2017

@cronwel I'm the author of tzinfo and tzinfo-data, so that's why I know how they can be used. The Gemfile syntax and bundler command are documented on the Bundler documentation site.

tobyprivett added a commit to uktrade/digital-workspace that referenced this issue Sep 21, 2017

pjvv added a commit to sanger/aker-reception-app that referenced this issue Mar 2, 2018

Update Gemfile and .lock
* Don't need tzinfo-data since we don't use Windows:
tzinfo/tzinfo-data#12 (comment)

@pjvv pjvv referenced this issue in sanger/aker-reception-app Mar 2, 2018

Merged

Remove broker configuration #236

@lifesucx

This comment has been minimized.

Show comment
Hide comment
@lifesucx

lifesucx Jul 12, 2018

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.

lifesucx commented Jul 12, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment