ruby-on-railsrubylinuxnginxspree

Ubuntu Rails Production server Permission denied


I am running into a issue where my rails server cannot edit files on the server.

I am running spree 4.3.2 and deployed via mina.

I am getting this error as a result

Permission denied @ `rb_file_s_rename - (/var/www/appname/releases/17/tmp/cache/.spree2Fbackend_configuration2Flocale20230327-1301-oq5zcj, /var/www/appname/releases/17/tmp/cache/E69/490/spree%2Fbackend_configuration%2Flocale)"

I have tried using chown and chmod but they are either temporary or just not even working.


Solution

    1. chmod -R 777 /var/www/appname/releases/17/tmp/cache
    2. Check if there are any SELinux or AppArmor policies that may be restricting the Rails server from modifying files. You can check the status of SELinux using the sestatus command, and AppArmor using the apparmor_status command.