Not able to install: gem install cocoapods in Macbook Terminal - ios

Not working below commands on MacBook Terminal:
gem install cocoapods,
gem install cocoapods-art
Getting bellow error message:
ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository
I have tried many solutions which are available on Google/Stackoverflow but not worked.
Thanks in advance.

If you have satisfied other conditions and you wish to install the latest version of cocoapods, you may wish to install using homebrew.
To do that, you can install with this command on your terminal;
brew install cocoapods
You will be required to link cocoapods after installing - to link, use;
brew link --overwrite cocoapods
Hope it works for you...

There can be different reasons for this.
Make sure you have Xcode installed on the system (its components too, Which it asks us to install on installation)
It can happen due to some network issues.try disabling IPv6, your can also try with a VPN connected and not connected both. ( you can also try this software, connect it and try:https://developers.cloudflare.com/warp-client/get-started/macos , it works for me on several network related issues on M1 chip macbook)
Try this command:
gem install cocoapods --source http://rubygems.org

Related

can't install cocoapods-keys in my M1 macbook

I tried to run pod install, it gives me the following error
[!] Your Podfile requires that the plugin `cocoapods-keys` be installed. Please install it and try installation again.
When I try to install cocoapods-keys, with this command gem install cocoapods-keys --user-install
it tells me the it's successfully installed
Successfully installed cocoapods-keys-2.2.1
Parsing documentation for cocoapods-keys-2.2.1
Done installing documentation for cocoapods-keys after 0 seconds
1 gem installed
But when I try to run pod install again it still tells me it's not installed
What's wrong?
Thank you in advance
I tried the following suggestion and it worked for me.
Solution

ERROR: Unable to download data from http://rubygems.org/ - timed out (http://rubygems.org/specs.4.8.gz)

I'm using a Mac Mini with Big Sur (Version: 11.2.3 (20D91)) and when running this command: sudo gem install cocoapods
I'm getting the following error
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from http://rubygems.org/ - timed out (http://rubygems.org/specs.4.8.gz)
I don't know what to do, please help!!
Okay I finally managed to solve it by following this steps:
Disable IPv6, here's how: How to disable IPv6 in Mac OS X
Restart Mac
Run sudo gem install cocoapods --source http://rubygems.org in terminal without changing directories.
I hope I can help anyone facing the same issue, since I know it can be really frustrating and it takes time that could've been used by working in your projects.
Thanks to darth_dever's answer, instead of step 3 run sudo arch -x86_64 gem install ffi in the terminal,then run arch -x86_64 pod install in the ios folderthat worked for me!
If you're facing this problem on a Linux guest machine (e.g an Ubuntu installed on VirtualBox, VMWare). Please Go to Setting -> Network -> Attached to NAT to solve the problem.

How to find if cocoaPods is installed in my mac

Can anyone help to find if cocoaPod is installed in my machine. I was trying to use Google Map in my application. So i was asked to install CocoaPods. Could any one help me explain me the purpose.
try to find pod version by running this in terminal
pod --version
If command not found then you didn't installed
To install cocoapods
sudo gem install cocoapods
Reference : https://cocoapods.org
Solution found: Initially the Cocoapods has to be installed using the command sudo gem install cocoapods (I had some problem with proxies so it dint work for me initially and i resolved it).
To find if Cocoapods is installed or not run cmd (pod --version). if theresult is (Not Found) Pods is not installed. Please check for the internet connection and their proxies, these things took me huge time.
Enter this line and see if you get error:
pod search realm

Cannot install cocoa pods after uninstalling, results in error

I removed cocoa pods because it claimed it had installed, but kept saying the command pod wasn't found afterward. When trying to reinstall cocoapods (sudo gem install cocoa pods -v) I get this error:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod
Any ideas?
As it has been pointed out below by Ramesh Ramchandaran, this is a cleaner way of doing it, instead of getting around the Security features of OS X.
sudo gem install -n /usr/local/bin cocoapods
Original Answer
I'm assuming you're running OS X 10.11.
This is happening because Apple has enabled rootless on the new install.
If you type:
sudo nvram boot-args="rootless=0"; sudo reboot
in terminal.app, your computer will reboot with it disabled.
Once that is done, type:
sudo gem install cocoapods -V
the -V is for verbose and will spit out any errors if they happen.
As rootless does not affect /usr/local/bin, the following succeeds:
sudo gem install -n /usr/local/bin cocoapods
Any caveats?
Using home-brew or custom $GEM_HOME can help resolving the issue.
I did clean installation of ruby with brew:
brew install ruby
Now the gem stuff seem to happen relative to my /usr/local/bin*, which is exactly what I needed.
I recommend installing all your gems into your .gem folder in your home folder to avoid using sudo or a ruby version manager as other people suggest.
All you have to do is update your .bash_profile by adding these 2 lines. (Don‘t forget to restart your terminal after applying these changes)
export GEM_HOME=~/.gem
export PATH="$GEM_HOME/bin:$PATH"
After updgrading from Yosemite to El Capitan ( 10.11.4), I kept getting the below error message while trying to 'reinstall' Cocoapods ( after trying out pretty much all the solutions under different Stackoverflow threads and the Cocoapods issue-page itself, for the same issue)
"Could not find a valid gem 'cocoapods' (>= 0) in any repository"
However, quit terminal, restarted system, created new Xcode project from the scratch and then when i did 'pod install', it worked.
Note: I was trying to use Alamofire and SwiftyJson cocoapods

Error installing Ruby gem Jekyll [duplicate]

I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link. I think it's an update to Ruby, but RVM is having trouble installing alternate versions of ruby as well.
Heres the full post:
$ sudo gem install jekyll
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out
Does this mean I need to update the version of ruby I'm using via rvm?
Ubuntu
sudo apt-get install ruby-dev
gem install jekyll
Your problem is that either you system doesn't know where make is located at or you don't have it installed. The easiest way to fix this (and probably other issues you'll run into trying to get a ruby system up and running) is to install xcode.
You can get it at http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 for lion. Or it came on a CD with your computer for earlier versions.
If you're using Lion, please see comments below for a link to how to install developer tools on Lion.
I had the same error on Ubuntu and this helped me sort it out.
You must have ruby-dev installed
apt-get install ruby-dev
If you installed XCode and command line tools are still missing go to Terminal and
xcode-select --install
it will prompt you to install these tools. After that just follow SrBlanco´s answer. That solved the problem for me.
Good luck.
Need to install "make".
I am using Ubuntu 12.10.
sudo apt-get install make
Should work on any Debian based distro.
Note: this problem also occurs on newer MacBook Pro models that come with Mavericks pre-installed. I updated another post with my own solution that didn't involve Xcode at all. My system had the Xcode developer tools installed when I got the machine.
ERROR: Error installing jekyll: ERROR: Failed to build gem native extension
Install Xcode as mentioned if you don't have it installed already (https://developer.apple.com/xcode/). Plus you need the command line tools.
Open Xcode. Go to Preferences > Downloads > Install Command Line Tools
Installing command line tools for Xcode solved the problem for me on my Mac
xcode-select --install.
sudo apt-get install ruby-dev
sudo gem install jekyll
hope this will help, it works with me.
I had this same exact error when trying to install Jekyll, and the following steps from this link helped me. Just in case anyone else comes across this!
http://davidensinger.com/2013/03/installing-jekyll/
I was facing the same issue in my Fedora 22 setup. I had ruby installed but didn't have ruby-devel. Installing ruby-devel fixed the issue for me.
dnf install -y ruby-devel
For older systems:
yum install -y ruby-devel
I followed this on Ubuntu/Linux Mint
sudo apt install build-essential
sudo apt install ruby-dev
sudo gem install jekyll
An addendum: You can install XCode now from the App Store on Mountain Lion. The process is transparent and pretty fast.
I had the same problems with you.
I use Mac OS X 10.9 develop preview version, and I had installed gcc and Xcode.
But my Xcode version is 4.6.
Then I install the Xcode 5.0
After that I type sudo gem install jekyll in the terminal again. Then it works.
Wish it could help someone.
Installing Xcode and going to perferencs > downloads > install commandline tools WORKS!
Same problem on Debian, I had forgot to run this command:
~/.rvm/scripts/rvm
All these answers did NOT work for me.
If you're looking for a solution on ubuntu 14.04, do this:
sudo apt-get install ruby1.9.1-dev zlib1g-dev nodejs
sudo gem install jekyll -v 2.5.3
Unfortunately, nodejs is required because of a bug in Jekyll that enforces existence of runtime JS engine even though it doesn't need one.
For Ubuntu, this helped in my case:
apt-get install libffi-dev
A general advice is to just follow what is displayed as the reason for the error and hopefully you'll be provided with a log file in which the first line suggests which package should be installed, in my case:
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/mkmf.log
MacOS
my solution to this problem
install xcode
type xcode-select --install in the command line
type sudo gem install jekyll in the command line
PS: It is the combination of the two answers in this question.
You are missing the ruby-dev file , just go ahead and run this command - sudo apt-get install ruby-dev
Hope this helps!!
I had the same issue on my macOS(10.14.2), the reason may be:
Apparently with OSX el Capitan, there is a new security function that prevents you from modifying system files called Rootless.
My solution is using rvm:
install ruby on Mac OS X with RVM
gem install jekyll
On windows I have this issue
I actually installed the version rubyinstaller-devkit-2.6.3-1-x64 of ruby
I have removed the ruby completely and Installed the rubyinstaller-devkit-2.5.5-1-x64
and issued the following commands on powershell
gem install bundler
gem install jekyll
and this time no errors where found
I had this issue and of all things, the error was occurring because I hadn't agreed to some updated terms of service in xcode. Running the following did the trick for me. Go figure.
sudo xcodebuild -license accept
For me, I had to upgrade homebrew and install rbenv to the latest ruby version. After that, I followed the instruction at jekyll website. My OS is Catalina 2019, I couldn't install Xcode, which is not compatible yet!
You have to set the path in your .bash_profile to make sure that it initializes the rbenv when you restart your terminal.
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
then
$ rbenv version
2.2.3 (set by /Users/mislav/.rbenv/version)
$ rbenv shell
rbenv: no shell-specific version configured
hope that help!
Here is the (only?) reliable and simple way to install Jekyll on macOS
Install UTM
Install Ubuntu Server
Install Jekyll using Ubuntu instructions at https://jekyllrb.com/docs/installation/ubuntu/
Forward port 22 in the VM settings (22->localhost->22)
Use VS Code on the macOS host
Install Remote SSH
Connect to USER#localhost
Drag and drop the folder on Mac into VS Code (this transfers files to remote)
Enable port forwarding for 4000 (bottom bar on VS Code)
Work on your website
Right click on your website on the file explorer and click download
If you have not done these steps, you might be delighted by:
Ubuntu imports your public SSH key from GitHub
VS Code magically handles file transfer in and out
VS Code magically installs your VS Code extensions onto the remote server and allows file search on the remote host

Resources