You cannot run CocoaPods as root - ios

when I execute sudo cordova requirements on my cordova project I get this response:
Requirements check results for ios:
Apple macOS: installed darwin
Xcode: installed [object Object]
ios-deploy: installed [object Object]
CocoaPods: not installed
/Users/username/.rvm/rubies/ruby-2.5.0/lib/ruby/gems/2.5.0/gems/claide-1.0.2/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
But I already installed successfully cocoapods:
MacBook-Pro-di-Name:~ username$ sudo gem install cocoapods
Successfully installed cocoapods-1.5.3
Parsing documentation for cocoapods-1.5.3
Done installing documentation for cocoapods after 4 seconds
1 gem installed
MacBook-Pro-di-Name:project-cordova username$ pod --version
1.5.3
I looked for a similar problem in other posts like here or here. If I try the second solution I get
MacBook-Pro-di-Name:project-cordova username$ sudo chown -R $USER ~/Library/Caches/CocoaPods
chown: /Users/username/Library/Caches/CocoaPods: No such file or directory
MacBook-Pro-di-Name:project-cordova username$ sudo chown -R $USER ~/.cocoapods
chown: /Users/username/.cocoapods: No such file or directory
MacBook-Pro-di-Name:sbc-cordova username$ sudo chown -R $USER ./Pods
chown: ./Pods: No such file or directory
I also tried to update Ruby version on my Mac. Nothing worked for me. I have Sierra (10.12.3) and last Cordova version (8.0.0), any idea to solve this problem? Thanks in advance

Related

Facing issue - bad interpreter: No such file or directory when used pod update on MAC

Getting error like:
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
I have tried to use sudo gem install cocoapods but it is giving
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.0/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20200605-20675-yfsgd0.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
Please help with this. Thanks!
Came to know that it is due to xcode installation issue. so have to agree to term
step 1: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
step 2: sudo gem install cocoapods (use sudo gem install cocoapods -n /usr/local/bin if you get permission issue)
step 3: pod update

Unable to install Cocoapods on macOS 10.15.4

When I perform sudo gem install cocoapods it returns the following:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200524-27428-t6f6h6.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.12.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.12.2/gem_make.out
Any idea what the problem is?
First install Homebrew if you don't have it: https://brew.sh/index_pt-br
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Second, install ruby if you don't have it:
https://www.ruby-lang.org/pt/documentation/installation/
brew install ruby
You can also follow these steps: https://gist.github.com/monicao/d372716cdfbb7e9cf692
Then, close your terminal and reopen it again.
Always use sudo to install cocoapods:
sudo gem install cocoapods
Also, you need to install Xcode's developer tools. The easiest way to do this is through terminal (this question)
xcode-select --install

gem native extension error while installing cocoapods

Am trying to reinstall cocoapods in my MacBook air after changing my SSD, now am getting this bellow error.
sudo gem install cocoapods
Building native extensions. This could take a while... ERROR: Error
installing cocoapods: ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r
./siteconf20200308-27204-6l0a5q.rb extconf.rb mkmf.rb can't find
header files for ruby at
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in
/Library/Ruby/Gems/2.3.0/gems/ffi-1.12.2 for inspection. Results
logged to
/Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.12.2/gem_make.out
Open Terminal
curl -L https://get.rvm.io | bash -s stable
Reopen Terminal
rvm install ruby-2.6
rvm use ruby-2.6.3
rvm --default use 2.6.3
From MahmoudKhaled's comment on
link
For me it worked by installing a previous version of cocoapods
sudo gem install cocoapods -v 1.8.4
Hope it helps
This error can be fixed by updating ruby to it's latest version version 2.3.0 is having that issue.
You can update the ruby version to latest one by following below steps.
Check the version of Ruby installed on your Mac
Open terminal and type:
ruby -v
Install the Ruby Version Manager rvm
In terminal,
curl -L https://get.rvm.io | bash -s stable
Once this command has finished running you may need to restart your terminal for rvm to be recognised.
Install the latest version of Ruby
rvm install ruby-[version]
In my case this was
rvm install ruby-2.7.1
This took a while to run as it had to install a lot of dependencies and asked for my permission a couple of times.
Set the latest version of Ruby as the one you want to use
You should now be running the latest version of Ruby. You can check as before with the ruby -v command as in step 1. If you’re find that you’re not, you can set this manually. In terminal type:
rvm use ruby-2.7.1
If you want to set this latest version of Ruby as the default version, in terminal type:
rvm --default use 2.7.1
After that done you can get your below command working for upgrading cocoapods
sudo gem install cocoapods
Probably you have not selected the Command Line Tool in Xcode > Preference > Location after an update.
The sudo gem install cocoapods command works after the tool is selected in Xcode.
Open terminal
xcode-select --install
Reopen Terminal
sudo gem install cocoapods
That's it!
Error: gem native extension error while installing cocoapods
Answer: Follow below 3 Steps issue will be fixed.
Step 1: Open XCode go to below path
XCode > Preferences > Locations > Command Line Tools (select-Xcode)
Step 2: Open Terminal- Paste the below Command
curl -L https://get.rvm.io | bash -s stable
Reopen Terminal -Paste the below Commands
Note: It will take 3-5 minutes
rvm install ruby-2.6
rvm use ruby-2.6.3
rvm --default use 2.6.3
Step3:
Open Terminal- Type below Command
sudo gem install cocoapods
Now gem native extension error while installing cocoapods will not come
Issue resolved.
I had the same error, I was unable to upgrade cocopods and the problem was that homebrew was failing to update.
I noticed that when trying to install a new ruby version with nvm, it was failing because it was trying to run homebrew update. So it seems nvm and homebrew are connected
I followed the instructions here: https://github.com/Homebrew/brew/issues/9420
basically
brew update (was failing)
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
brew update (successful)
brew install cocoapods
It didn't solve the error, but upgraded cocoapods in another way.
enter image description here
I used all the codes before and showed up there, when I tried to run flutter doctor for the millesimal time...
CocoaPods 1.8.4 out of date (1.10.0 is recommended)
I just changed to: sudo gem install cocoapods -v 1.10.0
and apparently installed the cocoapods.
brew cleanup -d -v
brew install /usr/local/bin cocoapods
Short answer:
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -sSL https://get.rvm.io | bash -s stable --ruby
sudo gem install cocoapods
For detail pls refer: another post's answer

Cocoapods on el capitan

I've just update my OSX to El Capitan. Now when I want to update my PodFile I get this error:
pod: command not found
Any help here?
The installation in /usr/local/bin worked perfectly:
sudo gem install -n /usr/local/bin cocoapods
but only with adding addtional rights I was able to access it
sudo chmod -R 755 /usr/local/bin
binstubs are no longer installed into /usr/bin.
If you are upgrading from Yosemite simply uninstall cocoapods (gem uninstall cocoapods or sudo gem uninstall cocoapods) and then run the following:
$ sudo gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:/Library/Ruby/bin
$ pod --version
0.38.2
It worked for me for the bug when run Cocoapods on El Capitan 10.11:
sudo gem install -n /usr/local/bin cocoapods
The same happened for me, sudo gem install cocoapods solved the issue

FlowType not installing with Brew

I can't get FlowType to install on Mac OS using brew. I typed:
$> brew update
...
$> brew install flow
Error: You must `brew link objective-caml' before flow can be installed
$> brew link objective-caml
Linking /usr/local/Cellar/objective-caml/4.02.1_2...
Error: Could not symlink share/man/man3/Weak.S.3o
/usr/local/share/man/man3 is not writable.
$>
What's wrong?
Please Try change Permission
sudo chown -R $USER /usr/local/lib
The official installation method for flow is locally per-project using yarn (or npm).
yarn add --dev flow-bin
OR
With npm:
npm install --save-dev flow-bin
See the full instructions at https://flow.org/en/docs/install/

Resources