I am trying to run integration test on my *nix development machine, but test can't execute, because permission denied.
ActionView:Template:Error: Permission denied @ dir_s_mkdir - home/alan/app/tmp/cache/asssets/test
Rails version is 4.2.0, Ruby 2.2.2p95. I'm using built in Rails server (Webrick). Processses are running under user alan, and tmp/ is owned by me (alan).
rake tmp:cache:clear
and restarting server didn't do the trick.
ls -alh outpuh is as follows:
drwxrwxr-x 14 alan alan 4,0K Kol 7 10:41 .
drwxr-xr-x 22 alan alan 4,0K Kol 7 09:10 ..
drwxrwxr-x 8 alan alan 4,0K Kol 4 14:37 app
drwxrwxr-x 2 alan alan 4,0K Kol 4 14:37 bin
drwxrwxr-x 2 alan alan 4,0K Kol 6 10:04 .bundle
drwxrwxr-x 5 alan alan 4,0K Kol 7 10:41 config
-rw-rw-r-- 1 alan alan 153 Kol 4 14:37 config.ru
-rw-rw-r-- 1 alan alan 16 Kol 4 14:45 contributors.txt
drwxrwxr-x 2 alan alan 4,0K Kol 7 11:59 db
-rw-rw-r-- 1 alan alan 652 Kol 7 10:41 Gemfile
-rw-rw-r-- 1 alan alan 5,3K Kol 7 10:41 Gemfile.lock
drwxrwxr-x 8 alan alan 4,0K Kol 7 10:42 .git
-rw-rw-r-- 1 alan alan 512 Kol 7 10:41 .gitignore
-rw-rw-r-- 1 alan alan 1,9K Kol 7 10:41 Guardfile
-rw-rw-r-- 1 alan alan 299 Kol 7 10:41 layout_file
drwxrwxr-x 4 alan alan 4,0K Kol 4 14:37 lib
drwxrwxr-x 2 alan alan 4,0K Kol 7 11:28 log
drwxrwxr-x 2 alan alan 4,0K Kol 4 14:37 public
-rw-rw-r-- 1 alan alan 249 Kol 4 14:37 Rakefile
-rw-rw-r-- 1 alan alan 219 Kol 4 14:37 README.md
drwxrwxr-x 8 alan alan 4,0K Kol 7 10:41 test
drwxrwxrwx 6 alan alan 4,0K Kol 6 10:04 tmp
drwxrwxr-x 3 alan alan 4,0K Kol 4 14:37 vendor
因为它是您的开发环境,所以将tmp
和log
文件夹的权限设置为755
或777
总是一个好主意。
chmod -R 755 tmp
Probably you somehow denied +x
on your directory. Just set it to all folder hierarchy (for your own user):
chmod +x /home
chmod +x /home/alan
chmod +x /home/alan/app
rm -rf /home/alan/app/tmp
mkdir /home/alan/app/tmp
chmod +x /home/alan/app/tmp
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.