Error while executing gem...Permission Denied - permissions

I am attempting to install taps from my Heroku app folder. When I type "gem install taps," I get the following error:
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24/bin/taps
I attempted to remove the taps-0.3.24 folder using rm -r and got this question: override rwxr-xr-x root/staff for /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24//bin/schema?
Upon typing yes, it tells me permission denied. Here is the whole exchange:
Jacob-MacBook-Pro:furious-ocean-6122012 jacob$ rm -r /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24/
override rwxr-xr-x root/staff for /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24//bin/schema? yes
rm: /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24//bin/schema: Permission denied
override rw-r--r-- root/staff for /Users/jacob/.rvm/gems/ruby-1.9.3-p194/gems/taps-0.3.24//bin/schema.cmd?
Any thoughts on how to resolve this issue would be appreciated. Thanks!

I just ran into this when trying to get the Heroku Toolbelt running. I was able to remove the old version with sudo rm -rf /path/to/gems/taps-x.x.x and then re-install (without sudo).

You should add "sudo" before "gem...."

Related

neovim :PlugUpdate produces permission denied on all plugins

When entering in vim and then running :PlugUpdate all the plugins can't be updated because of the error
x <PLUGIN>:
error: cannot open .git/FETCH_HEAD: Permission denied
I was able to upgrade VimPlugin with :PlugUpgrade without any issues.
I was able to update this before without any issues about a month ago, I found an article saying that I need to change the ownership of the directory with chown which I am assuming would need to be done at $ sudo chown -R ~/.config/nvim/ but if I don't need to change owner then I'd prefer not to
I was able to resolve it by changing ownership with $ sudo chown -R $USER ~/.config/nvim/
note make sure to $ echo $USER to make sure that it's the user you wish to change the ownership of the directory

The web server not permitted for chmod under WSL Ubuntu

I use Ubuntu 18 as WSL and everything was running well. Today I run the apache and started the application. When the app tried to perform chmod() on a file which was submited through form inside the folder project (I use Laravel), I received the following error:
chmod(): Operation not permitted
I have notice that this error happen when I try running chmod() from web server (www-data user). In the cli I dont have problems.
From other posts over the net, I understand that Windows has some changes regarding WSL permissions and drive mounts. But I didnt get answer or didnt succeed to resolve that issue.
sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata
Reference: https://github.com/Microsoft/WSL/issues/3172#issuecomment-389157376
sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata,uid=1000,gid=1000,umask=22,fmask=111
did the trick for me.
Ref: https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/

How to solve permission denied error with react native?

UPDATE:
In terminal I see this file has "-rw-r--r--". What command do I need to run in order to change this to the right permission?
I'm trying to run
react-native run-ios
and I keep getting the error shown below:
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EACCES: permission denied, open '/Users/sharatakasapu/Desktop/projects/albums/node_modules/.cache/#babel/register/.babel.7.2.2.development.json'
at Object.fs.openSync (fs.js:646:18)
at Object.fs.writeFileSync (fs.js:1299:33)
at save (/Users/sharatakasapu/Desktop/projects/albums/node_modules/#babel/register/lib/cache.js:52:15)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
I tried to follow along at why babel stores .babel.json in USERPROFILE path but didn't understand how to use this to solve the problem I have as I'm new to react. Any advice on how to address this?
About this i have seen this issue quite some time ago!
there can be too cases they might sound pretty lame though but bear with me and read!
1: the user profile you are using has no access to the files that are being targeted! or you might not have access to root node Packages! what you can do is
sudo chmod -R 777 /Users/sharatakasapu/{your node module path}
but the solution one seems a little trivial!
2: allowing your present user to read all cache and property files + folders! by doing
sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config
for more you can follow these links .
for solution 1: stackLink
for solution 2: githubLink
Had the same problem.
This worked for me:
run
whoami to get the current user.
run: sudo chown -R ownerName: /path/to/node_modules
It looks like you have no permission- try this
sudo chmod -R 777 {path}
You can try having a look at these two examples:
https://github.com/bower/bower/issues/2262
Error: EACCES: permission denied
Also try running your terminal as an Administrator if possible.
If you give permissions, your error must no longer be visible.
Generally on a MAC, the command is:
sudo chown YourName:staff /Users/YourName/.babel.json
anyone can move to project inside just move to ios folder there you can find your node module inside that check the path of every script and navigate them in terminal then try to use this command chmod 755 yourscriptname.sh
Note for my future self. An incompatible drive format might be the error:
"Permission Denied" in Node on Linux, when running start-script /w local nodemon/mocha/babel-node
Give permission to the .babel file

Permission Denied error for Vagrant

I made the mistake of once running "sudo vagrant up" and now whenever I run "vagrant up" it gives me the following error
==> default: Running cleanup tasks for 'chef_solo' provisioner...
/opt/vagrant/embedded/gems/gems/vagrant-1.7.1/lib/vagrant/environment.rb:492:in `initialize': P Permission denied - /Users/mkv/.vagrant.d/data/lock.fpcollision.lock (Errno::EACCES)
I've tried deleting the .vagrant folder and also the Cheffile but I always get the same error.
What can I do to sort this out?
The issue is related with permission which you accidentally run the application with root.
Follow the steps:
Delete /Users/mkv/.vagrant.d/data/lock.fpcollision.lock and run vagrant up again.
Find any files are owned by root under /Users/mkv, include hide files. if found, change it back to your own user account.
You can run below command to find out files owned by root
find /Users/mkv -type f -user root -print
For those who wonder how to change a user to your current one, using find command:
sudo find ~/.vagrant.d/data/lock.fpcollision.lock -type f -user root -exec chown $USER {} \;

How to get permission to edit the file apache2.conf? [Ubuntu]

I'm a beginner Ruby on Rails Programmer and I'm trying to install Apache2 + Passenger(That's for Rails Deployment).. and at the end of the installation process, Passenger gave me a few lines to add to the file apache2.conf at /etc/apache2/ but I can't override this file.. I have no permission =( I've also uploaded an image showing me the error.
P.S => I'm logged into Ubuntu with my username and password.
Please help! and thanks,
Rodrigo.
The simplest way is to open the file with the sudoedit program, as in
sudoedit /etc/apache2/apache2.conf
which will prompt for your password and then open your editor.
After the installation has completed, add phpmyadmin to the apache configuration.
sudo nano /etc/apache2/apache2.conf
Add the phpmyadmin config to the file. Include
/etc/phpmyadmin/apache.conf
Restart apache:
sudo service apache2 restart
If you are a beginner in GNU/Linux, I want to notice, for run command with root privileges run it with sudo:
sudo <your_command>
If you want to get root privileges for current terminal session (no need to type sudo each command) run:
sudo -i
I hope this will help someone considering the number of years since the last post. I tried this, and it worked for me.
sudo bash
Then the command to edit. Then save the file. Below is the site I got the procedure from.
https://ubuntuforums.org/showthread.php?t=1845306
Enter the command:
sudo nano /etc/apache2.conf
Or you can use the following chmod 777 usr/local/apache2/conf/httpd.conf
this will enable you to read/write the config file but be warned if you are planning on putting apache2 online you must revert it back to the old permissions chmod 640 usr/local/apache2/conf/httpd.conf