LoginSignup
0
0

More than 1 year has passed since last update.

<備忘録>Railsアプリでパーミッションエラー

Last updated at Posted at 2022-05-09

今回はRailsアプリで発生したパーミッションに関するエラーの
対策を備忘録として残します。

rails s 時に発生

Errno::EACCES (Permission denied @ apply2files - /Users/ユーザーネーム/Documents/homepage/homepage_on_ruby_on_rails/homepage/tmp/cache/assets/sprockets/v4.0.0/Ku/KueVW_Fgne0MoM9sWUxwZLSJS_YpySO0N2iIaOhPsgg.cache):

とエラーが表示されビューが返されませんでした。

どうやら権限がない?ということらしい。

確認します。

$ ls -al /Users/ユーザーネーム/Documents/homepage/homepage_on_ruby_on_rails/homepage/tmp/cache/assets/sprockets/v4.0.0/ku              
total 8
drwxr-xr-x    3 root            staff     96  5  9 14:02 .
drwxr-xr-x  630 ユーザーネーム    staff  20160  5  9 19:30 ..
-rw-r--r--    1 root            staff    123  5  9 14:02 KueVW_Fgne0MoM9sWUxwZLSJS_YpySO0N2iIaOhPsgg.cache

所有者がrootになっているので一般ユーザー(ユーザーネーム)に変更します。

$ sudo -R chown ユーザーネーム  /Users/ユーザーネーム/Documents/homepage/homepage_on_ruby_on_rails/homepage 

無事ビューが返ってきました。

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