I have a problem here. I've installed cocoapods on my Mac because I need it for my XCode project. I've runned this command
gem install cocoapods
which works fine, all things were installed. But I after that when I tried to use any pod COMMAND thing, I've got the error - You cannot run CocoaPods as root.
I've looked through stackoverflow, and the main advices were to use this commands
sudo chown -R $USER ~/.cocoapods or sudo chown -R $USER ~/Library/Caches/CocoaPods
but the problem is none of those commands were working for me and I've got this error:
chown: /Users/user/.cocoapods: No such file or directory
Could you tell me where I'm wrong?
Ok, guys, I've figured out the problem. Just need to do what the error says. You shouldn't run pod install command with sudo or from the root user. It means - just open new terminal window and don't log to the root user and work with pod
Related
I am trying to run a react native project but I keep getting:
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2020-12-20T01:04:27,184: [0x118044e00] the owner of /usr/local/var/run/watchman/mattroberts-state is uid 0 and doesn't match your euid 501
I think it is a permission problem but I don't know how to fix it. Does anyone know what is wrong and how to fix it?
If I could get the uid to match the euid, it seems it should be fixed, but I don't know how.
If I could get the uid to match the euid, it seems it should be fixed, but I don't know how.
Looks like the owner of the watchman state directory is set to root. You can fix it by running:
sudo chown -R "$(whoami)" "/usr/local/var/run/watchman/$(whoami)-state"
While I was unable to fix Watchman, after uninstalling it the React Native app runs. I don't think it will automatically reload, but you can still cause a reload to occur with command r in the simulator.
Since I had installed Watchman with homebrew,
I uninstalled it with
brew uninstall Watchman
in the terminal
this worked for me
sudo chmod 0700 /usr/local/var/run/watchman/$(whoami)-state
I'm new to CocoaPods, I tried running 'pod install' on my Mac to install my pod, but I'm getting a permissions error with the folder /Users/username/Library/Caches/CocoaPods. That folder doesn't even exist! Did I accidentally delete it at one point? How do I restore it?
There is however a folder called /Library/Caches but its not under my username, its at the root.
I'm a little confused. If someone can just direct me in the right direction, I would really appreciate it.
Here is the full error message:
Errno::EACCES - Permission denied # dir_s_mkdir - /Users/nachshonfertel/Library/Caches/CocoaPods
You can solve this in 2 ways.
Add CocoaPods folder on ~/Library/Caches/CocoaPods then try
pod install
OR
Give full permission on you project
cd your-project
chmod -R 777 .
cd ios
pod install
Turns out it was a permissions error. And the folder I thought didn't exist, was hidden in finder > Go > (Hold Down Option Key) Library
Took me 2 full days to finally figure it out!
Are you using system Ruby or have you installed Ruby with sudo?
You basically have 2 options:
use sudo pod install
Probably the easiest/fastest way for you go forward
This typically causes more problems than Ruby being owned by non-root
When you install packages they will have sudo access!
Install Ruby, non-sudo; you can try
github.com/postmodern/ruby-install together with github.com/postmodern/chruby (my personal favourite), rvm.io is also very popular
The benefit of this approach is that you also can switch Ruby version whenever you like (and as mentioned above; more secure less insecure..)
I had been struggling with this issue for a while. For some reason, in my case the problem was that the folder ~/Library/Caches/CocoaPods was not there, and cocoapods wasn't able to create it when running 'pod install'. Hence the permission error.
After trying several things, I created that folder manually (which prompted for my password), ran 'pod update' and my problem was fixed!
Hope this saves someone some trouble.
I solved the problem creating the missing folder Users (in my case the error was Permission denied # dir_s_mkdir - /Users/Users) and give full permission to all users.
I managed to solve my issue in following steps:
Create CocoaPods folder (if it doesn't exist) cd ~/Library/Caches && mkdir CocoaPods
Give access to CocoaPods folder sudo chmod 777 Cocoapods
Create Pods folder cd CocoaPods && mkdir Pods
Give access to Pods folder sudo chmod 777 Pods
I hope it helps !
Downloaded Vagrant, and went through th installation process.
When I ran vagrant -v it says vagrant: command not found
It has put the files in /opt/vagrant/...
It should install in the Applications folder with a link to the /usr/bin so it is added to the shell path.
There is no directory that has been created during this process.
I am afraid I can't even get started with it. ITs obviously not creating all the shortcuts it needs to be able to run the commands.
I have looked for support on this issue and reported a bug.
I also accepted the xcode licence agreement.
Has anybody else had this issue.
My next step is to manually create the shortcuts.
If you look at the uninstall script including in the Vagrant DMG, it is referring to /usr/local/bin which does not exist. It should be error handling (the Vagrant pkg installer) and create it (permissions/ownership etc) but it doesn't.
You need to mkdir the /usr/local/bin. I tried a symlink between /usr/bin/vagrant (as /usr/bin exists, and in-path) to /opt/vagrant/bin/vagrant BUT this does not work, as later on in life, Vagrant refers in a hard fashion to /usr/local/bin/vagrant because its stupid.
$ sudo mkdir /usr/local/bin
If you sudo it, it should be made with correct ownership etc. Now just re-run the Vagrant installer pkg.
Make sure the Virtual Box setup is installed on Mac before installing Vagrant.
I raised the bug with https://github.com/mitchellh/vagrant/issues/6034
The issue is that I had no /usr/local directory at all.
It is an apple issue.
After I created the directories as you described I was able to install vagrant vitrual boax and laravel.
Here is what I did.
sudo mkdir /usr/local
Then bin.
cd /usr/local
sudo mkdir bin
I uninstalled Vagrant, re-installed and when I ran vagrant -v I then got the version.
cd /usr/local/bin
ls
sudo chmod 755 vagrant
Thanks for your Answer.
Weird, on 1.8.5 I couldn't run Vagrant either, noticed that /usr/local/bin was owned by root. Ran command
# chown -R User:Group /usr/local/bin
as root and works from my username now.
I followed this Up and running with PhoneGap on Mac OSX on every single step but then I got stuck with
I have tried many solutions and fixes but still nothing is working. I followed this answer but still stuck.
What could be the cause for these issues?!
Update1:
When I install cordova using sudo npm install -g cordova I get the following:
Even when I type cordova, I get -bash: cordova: command not found
Update2:
I fixed cordova installation using the following steps:
sudo chown -R $USER /usr/local
sudo chmod -R 0775 /usr/local
Add it to the path using this answer
Add the path to bash_profile using this link
Open the terminal and type cordova -v and you get it working displaying the version
Phonegap is still failing and can't seem to find a fix for it
I found an issue when running sudo pod install command after updating it to latest version 0.32.1. Earlier it was working very fine.
When I tried to do pod install with older cocoapods, it asked me to update to latest cocoapods version i.e. 0.32.1. After I updated by cocoapods gem, I can't do sudo pod install in my Xcode project. It gives me following error.
± sudo pod install ruby-1.9.3-p0
Password:
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/gems/1.9.1/gems/claide-0.5.0/lib/claide/command.rb:328:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
CocoaPods, the Objective-C library package manager.
Commands:....
Any suggestion to overcome the issue would be very helpful. Thanks in advance.
I had to update permission on CocoaPods
sudo chown -R $USER ~/Library/Caches/CocoaPods
sudo chown -R $USER ~/.cocoapods
Since it seems to fix the problem for some people, you might want to try running "pod install" and see if it fixed your problem from that point. However, I still had a permission denied when running "pod install" for a pod item, so running the next line will overwrite permission for the pod folder.
sudo chown -R $USER ./Pods
I have removed the old podfile.lock before running pod install
Source :
cocoaPods pod install Permission denied
https://github.com/CocoaPods/CocoaPods/issues/509
I am working with windows. After reading all tips which didn't work I drove into the code base.
As a disclaimer, I am beginning phase of developing an app and my goal is to get a quick proof of concept. Therefore, this solution will only bypass that the error message as a quick hack.
In the file ~/lib/cocoapods/command.rb you will find a function on line 47 that stops the program if there is a root user.
#help! 'You cannot run CocoaPods as root.' if Process.uid == 0
Simply comment out the line. Again, this is a terrible idea to do in any situation except as a pragmatist using Windows and trying to get proof of concept out.
Nothing worked for me except the following
switched to ios platform with cd platforms/ios
switched ownership of the folder to the current user with sudo chown -R YourUsername .
Pod install
In m1 MACs run sudo arch -x86_64 pod install --allow-root to resolve this issue.
in my case, the both "folder content project" and file "project.xcodeproj" was locked "i ignore why !!! maybe the git clone provoked error :s", i unlock the folder and apply all changes for sub folder .... And it WORK FINE :D