LoginSignup
7
3

More than 5 years have passed since last update.

【回避方法】passengerでRails5.2アプリが起動しない

Last updated at Posted at 2018-06-17

はじめに

Ruby 2.5.1 + Rails 5.2 環境で作成したアプリをphusion/passenger-ruby25イメージを利用してコンテナ化した際に何箇所か引っかかったところがあったので備忘録として投稿します。

問題点

Rails 5.2 のアプリがPassengerで起動しない

原因調査

ログ

ログを確認したところbootsnapが原因と思われるエラーを出力していた。

Error: The application encountered the following error: Permission denied @ rb_sysopen - /home/app/webapp/tmp/cache/bootsnap-load-path-cache.52.85473.tmp (Errno::EACCES)

フォーラム

bootsnapのissueに同じ内容の投稿があり、アクセス権限の変更などが提案されていたが、自分の環境では解決しなかった。

Errno::EACCES: Permission denied · Issue #77 · Shopify/bootsnap

回避方法

bootsnapを利用しないように設定する。
config/boot.rbrequire 'bootsnap/setup'をコメントアウトする)

config/boot.rb
# require 'bootsnap/setup'

補足:
bootsnapはRails 5.2から追加された起動時間を短縮させるgem

備考

回避方法を実施した後は、bootsnapが有効な新規アプリを含んだコンテナイメージを作成しても再発しなくなった🤔

7
3
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
7
3