1
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?

More than 1 year has passed since last update.

erb2hamlのライブラリが見つからずデプロイ失敗

Posted at

概要

erb2hamlのgemがデプロイのビルド時に見つからず、そのせいでビルドが失敗。
なかなか解消せず、最終的に原因不明のまま解決したのでどなたかのご参考になれば。

開発環境

  • Mac M2チップ
  • Ruby on Rails 6.0.6.1
  • Heroku

結論

erb2hamlのgemを削除して依存関係を再インストール。その後デプロイし直したらビルド成功した。
そもそも不要なライブラリを残しておいたのがよくなかった。

経緯

Herokuにデプロイを実行中、「erb2hamlの依存関係があるのに、gemが見つからないためビルドできない」という警告が出た。

依存関係に問題があるのかと思い、yarn.lockとgemfile.lockを削除してから再インストールを実行してみたが解消せず。

「本番環境でgemを見つけるには・・・」と考え、gemfile内のdevelopment項目に記述していたerb2hamlのgemをproductionの項目に移してみたが解消せず。

煮詰まっていたが「そもそもこのgemって本番環境で必要なのか?erb2hamlはerbをhamlに一括変換するためのライブラリじゃん」と気付く。

既にすべてのビューページをhamlで作成しており不要なライブラリだったので、gemを削除して依存関係を再度bundle installしてデプロイ実行。成功した。

そもそもの必要性が無いライブラリのために苦労したお話でした。煮詰まったときに視点を変えることの重要性を感じました。

1
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
1
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?