[ACCEPTED]-Ruby on Rails: permission denied when using "rails generate controller welcome-ruby-on-rails-3
I solved that problem by running
sudo chmod -R 1777 /tmp
hope this 2 helps other people like me who would prefer 1 not having to deactivate the spring gem
It needs ownership to write the re-write 3 the pid for each server start.
I had to 2 run it with my full local path & sudo
$ sudo 1 chmod -R 777 /Users/MyName/Desktop/projects/my_project/tmp/
I took a look at the library that's trying 5 to write the pid file, lib/spring/env.rb
.
The function in 4 question tries to create a temporary directory 3 at the same location each time unless the 2 XDG_RUNTIME_DIR
is set:
path = Pathname.new(File.join(ENV['XDG_RUNTIME_DIR'] || Dir.tmpdir, "spring"))
Setting said variable to a unique 1 directory does the trick for me:
export XDG_RUNTIME_DIR=/tmp/`whoami`
Missing permission for tmp folder to writable 1 . run chmod 777 tmp/
I had this same issue when working on a 21 Rails 6 application in Ubuntu 20.04.
Each 20 time I run the command rails assets:clobber
to remove the old 19 assets in public/assets
completely, I get the error:
errno::enotempty: directory 18 not empty @ dir_s_rmdir
errno::eacces: permission 17 denied @ apply2files
And the logs pointed 16 the path to the file causing it, which in 15 my a case was the public/packs/manifest.json
file.
I tried deleting 14 it or changing permission but nothing worked. I 13 also tried deleting the tmp
directory in the 12 project, but it did not work.
Here's how I fixed it:
I listed all 11 the files and directories in that directory 10 using the ls -lh
command, which gave me this output:
-rw-rw-r-- 1 promisechukwuenyem promisechukwuenyem 1.7K Oct 6 20:29 404.html
-rw-rw-r-- 1 promisechukwuenyem promisechukwuenyem 1.7K Oct 6 20:29 422.html
-rw-rw-r-- 1 promisechukwuenyem promisechukwuenyem 1.6K Oct 6 20:29 500.html
-rw-rw-r-- 1 promisechukwuenyem promisechukwuenyem 0 Oct 6 20:29 apple-touch-icon.png
-rw-rw-r-- 1 promisechukwuenyem promisechukwuenyem 0 Oct 6 20:29 apple-touch-icon-precomposed.png
drwxr-xr-x 3 promisechukwuenyem promisechukwuenyem 4.0K Oct 13 09:20 armstrong_tools
-rw-rw-r-- 1 promisechukwuenyem promisechukwuenyem 0 Oct 6 20:29 favicon.ico
drwxr-xr-x 3 root root 4.0K Oct 8 13:06 packs
-rw-rw-r-- 1 promisechukwuenyem promisechukwuenyem 99 Oct 6 20:29 robots.txt
I 9 realized that the permissions for the files 8 and directories were fine, however, the 7 packs
directory had root
ownership which was seperate 6 from persmission of other files and directories:
drwxr-xr-x 3 root root 4.0K Oct 8 13:06 packs
I 5 simply ran the command below to change the 4 ownership from root to promisechukwuenyem:
sudo chown -R promisechukwuenyem:promisechukwuenyem packs/
Now 3 when I ran the command rails assets:clobber
to remove the old 2 assets in public/assets
completely, it worked just fine.
That's 1 all.
I hope this helps
I am getting this type of error(permission 2 denied @ apply2files) when using rails server
.
sudo rails server
solve 1 my problem.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.