Search code examples
ruby-on-railstzinfo

Platform of gem tzinfo-data for both 32bit and 64bit Ruby on windows


Our development computer has both 32 and 64bit ruby installed. The tzinfo-data needs to specify the platforms which blows up the Rails 4.2 app.

For 64bit ruby, the Gemfile has:

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

For 32bit ruby, the `Gemfile' has:

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

App blows up if running 32bit ruby with 64bit platform or vise verse.

How to specify platform which is good for both 32 and 64bit ruby?


Solution

  • This should work on both 32-bit and 64-bit Ruby:

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

    You could also remove the platforms option altogether:

    gem 'tzinfo-data'
    

    Make sure that you've run the bundle update command with both your 32-bit and 64-bit Ruby versions to install the tzinfo-data gem into that Ruby installation.

    For more information about what the platforms option does, please refer to the Gemfile manual page.