0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

エラー:There was an error parsing `Gemfile`: `windows` is not a valid platform.への対処

Last updated at Posted at 2025-01-24

ハマったこと

環境構築中に次のエラーに遭遇。

[!] There was an error parsing `Gemfile`: `windows` is not a
valid platform. The available options are: [:ruby, :ruby_18,
:ruby_19, :ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24,
:ruby_25, :ruby_26, :mri, :mri_18, :mri_19, :mri_20, :mri_21,
:mri_22, :mri_23, :mri_24, :mri_25, :mri_26, :rbx, :truffleruby,
:jruby, :jruby_18, :jruby_19, :mswin, :mswin_18, :mswin_19,
:mswin_20, :mswin_21, :mswin_22, :mswin_23, :mswin_24, :mswin_25,
:mswin_26, :mswin64, :mswin64_19, :mswin64_20, :mswin64_21,
:mswin64_22, :mswin64_23, :mswin64_24, :mswin64_25, :mswin64_26,
:mingw, :mingw_18, :mingw_19, :mingw_20, :mingw_21, :mingw_22,
:mingw_23, :mingw_24, :mingw_25, :mingw_26, :x64_mingw,
:x64_mingw_20, :x64_mingw_21, :x64_mingw_22, :x64_mingw_23,
:x64_mingw_24, :x64_mingw_25, :x64_mingw_26]. Bundler cannot
continue. # from /myapp/Gemfile:21 # ----------------------------
-------------- # # Windows does not include zoneinfo files, so
bundle the tzinfo-data gem > gem "tzinfo-data", platforms: %i[
windows jruby ] # # -------------------------------------------
run bundle lock --add-platform=x86_64-linux [!] There was an
error parsing `Gemfile`: `windows` is not a valid platform. The
available options are: [:ruby, :ruby_18, :ruby_19, :ruby_20,
:ruby_21, :ruby_22, :ruby_23, :ruby_24, :ruby_25, :ruby_26, :mri,
:mri_18, :mri_19, :mri_20, :mri_21, :mri_22, :mri_23, :mri_24,
:mri_25, :mri_26, :rbx, :truffleruby, :jruby, :jruby_18,
:jruby_19, :mswin, :mswin_18, :mswin_19, :mswin_20, :mswin_21,
:mswin_22, :mswin_23, :mswin_24, :mswin_25, :mswin_26, :mswin64,
:mswin64_19, :mswin64_20, :mswin64_21, :mswin64_22, :mswin64_23,
:mswin64_24, :mswin64_25, :mswin64_26, :mingw, :mingw_18,
:mingw_19, :mingw_20, :mingw_21, :mingw_22, :mingw_23, :mingw_24,
:mingw_25, :mingw_26, :x64_mingw, :x64_mingw_20, :x64_mingw_21,
:x64_mingw_22, :x64_mingw_23, :x64_mingw_24, :x64_mingw_25,
:x64_mingw_26]. Bundler cannot continue. # from /myapp/Gemfile:21
# ------------------------------------------- # # Windows does
not include zoneinfo files, so bundle the tzinfo-data gem > gem
"tzinfo-data", platforms: %i[ windows jruby ] # # ---------------
--------------------------- run bundle binstubs bundler [!] There
was an error parsing `Gemfile`: `windows` is not a valid
platform. The available options are: [:ruby, :ruby_18, :ruby_19,
:ruby_20, :ruby_21, :ruby_22, :ruby_23, :ruby_24, :ruby_25,
:ruby_26, :mri, :mri_18, :mri_19, :mri_20, :mri_21, :mri_22,
:mri_23, :mri_24, :mri_25, :mri_26, :rbx, :truffleruby, :jruby,
:jruby_18, :jruby_19, :mswin, :mswin_18, :mswin_19, :mswin_20,
:mswin_21, :mswin_22, :mswin_23, :mswin_24, :mswin_25, :mswin_26,
:mswin64, :mswin64_19, :mswin64_20, :mswin64_21, :mswin64_22,
:mswin64_23, :mswin64_24, :mswin64_25, :mswin64_26, :mingw,
:mingw_18, :mingw_19, :mingw_20, :mingw_21, :mingw_22, :mingw_23,
:mingw_24, :mingw_25, :mingw_26, :x64_mingw, :x64_mingw_20,
:x64_mingw_21, :x64_mingw_22, :x64_mingw_23, :x64_mingw_24,
:x64_mingw_25, :x64_mingw_26]. Bundler cannot continue. # from
/myapp/Gemfile:21 # ------------------------------------------- #
# Windows does not include zoneinfo files, so bundle the tzinfo
data gem > gem "tzinfo-data", platforms: %i[ windows jruby ] # # 
------------------------------------------

エラーの内容

Windowsに特有のgemがある場合に関連するエラーっぽく、
Gemfileのこの辺で発生しているとのこと。

gem "tzinfo-data", platforms: %i[ windows jruby ]

gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"

解決に向け、したこと

このページを参考に、コンテナ内でgem updateとgem "tzinfo-data", platforms: %i[mswin mswin64 mingw x64_mingw jruby ]を行なったものの、エラーは続く。

その後debug辺りでも同じようなエラーが発生していることが気になり、VSCodeにインストールしていたRuby-LSPをアンインストールし、setting.jsonの設定箇所を削除。

直接的な原因がわからないものの、解決。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?