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?

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

Last updated at Posted at 2024-12-26

概要

ユーザー登録機能の実装時 Gemfileにdeviseを追加しようとしたところ、エラーの発生。
解決までの手順をこちらに記載。
platforms: %i[ windows jruby ] の指定は、WindowsやJRuby環境でのみこのgemをインストールすることを意味するようです。

環境

OS:Mac M2チップ搭載
ruby: ruby 3.3.3
Rails: 7.1.3
Bundler 2.3.15

実施したこと

1.下記記事を参考にコマンドを実施後、bundle install。解決されず。
https://qiita.com/tatama/items/3f0f5e42cb5f75b53817

bundle config --local disable_platform_warnings true 

2.Gemfileの問題の記述部分を修正後、bundle install。

 gem "tzinfo-data", platforms: %i[ windows jruby ] 
 gem "tzinfo-data" #Gemfileの記載を上記からこちらに変更

・下記部分でエラー発生。

 gem "debug", platforms: %i[ mri windows ]
 
#エラー文
[!] There was an error parsing `Gemfile`: `windows` is not a valid platform. The available options are:

・dockerコンテナ内で、下記コマンドを実施。

 docker-compose run web bundle install

・dockerコンテナ内に移動し、deviseのインストール

 rails generate devise:install
0
0
3

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?