I just start learning swift and found I can get a lot of libraries from cocoapods, so I start installing the cocoapods by running sudo gem install cocoapods, however I got the following error during the installation:
Successfully installed concurrent-ruby-1.1.6
Successfully installed i18n-0.9.5
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.7
Successfully installed activesupport-4.2.11.3
Successfully installed nap-1.1.0
Successfully installed fuzzy_match-2.0.4
Successfully installed httpclient-2.8.3
Successfully installed algoliasearch-1.27.2
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 ./siteconf20200527-3399-1uix5ob.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
I am running macOS Catalina 10.15.2 with Xcode 10.3, not sure is that because of the masOS is outdated, if so is there any way that I can fix the installing issue without updating the macOS?
Same thing happened to me after I erased Macintosh HD from macOS Recovery > Disk Utility and then reinstalled macOS Catalina from macOS Recovery too.
Now, I'm on macOS Catalina 10.15.7 and this error happened when I ran sudo gem install cocoapods.
I'm not sure yet why, but installing cocoapods via Homebrew worked for me.
brew install cocoapods
brew install cocoapods
If you don't have Homebrew yet, run the following on your terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Related
I'm running the install with an admin account I tried
sudo gem install cocoapods
and
sudo gem install cocoapods -n /usr/local/bin
They both run fine with following output
Fetching cocoapods-1.9.1.gem
Successfully installed cocoapods-1.9.1
Parsing documentation for cocoapods-1.9.1
Installing ri documentation for cocoapods-1.9.1
Done installing documentation for cocoapods after 2 seconds
1 gem installed
however, a simple
pod --version
Returns
zsh: command not found: pod
I'm not too good at managing users accounts or dealing with command shell but I scoured the net and couldn't find a solution. It looks like wherever pod is installed, it doesn't make it to the list of executable applications
The issue was that command line for XCODE was not installed.
First I updated to latest Ruby version and put the version number in the second command (in place of [version]
curl -L https://get.rvm.io | bash -s stable
rvm install ruby-[version]
During the install you will see the Software update available from MAcOS popup. Install immediately and continue with prompts in that window (I believe it asks for updates and then asks for install.
It will take a while to run / download / install (it took 2 expressos for me :) )
After that I ran
sudo gem install cocoapods
And restarted my terminal.
Now checking it's installed
pod --version
Returns the installed version (1.9.1 for me)
I followed these instructions but ended up with the same issue. So I ran gem list | grep cocoapods and then uninstalled every instance of cocoapods with gem uninstall cocoapods along with the executables. Then I decided to install cocoapods using Homebrew with brew install cocoapods, restarted my Mac and the pod command was available. Remember I didn't restart my Mac after using sudo gem install cocoapods,maybe that will work too, you can try.
I have installed the Cocoapods-art in the bundle using this command:
bundle exec gem install cocoapods-art
This is the success message:
Fetching cocoapods-art-1.0.4.gem
Successfully installed cocoapods-art-1.0.4
Parsing documentation for cocoapods-art-1.0.4
Done installing documentation for cocoapods-art after 0 seconds
1 gem installed
when I execute: bundle exec gem list, I don't see Cocoapods repo-art in the gem list.
When I try to add: pod repo-art add folderNamer, I get:
[!] Unknown command: `repo-art`
Did you mean: repo?
My problem was:
Installing cocoapods by gem in MacOS Catalina + Xcode 12.2, I got the error:
You have to install development tools first
...
checking for ffi.h... * extconf.rb failed *
Then I installed the cocoapods (1.10.1) by homebrew
brew install cocoapods
And the cocoapods-art was installed with gem
gem install cocoapods-art
At that moment, I was with the same error.
For me, its finally worked removing and installing again the cocoapods-art with sudo.
This troubleshooting - https://developer.apple.com/forums/thread/668456 don't resolving to use the last version of cocoapods ;)
I was getting same error with gem install cocoapods-art. Then I used the command sudo gem install cocoapods-art and it worked :)
I'm trying to install a more recent version of Ruby on Snow Leopard so I can install Jekyll. When trying to install any version of Jekyll I get an error saying that it requires liquid, which requires ruby v2+.
If I try upgrade via rbenv I get the following when trying all versions:
error: failed to download ruby-2.1.1.tar.bz2
BUILD FAILED (OS X 10.6.8 using ruby-build 20181019)
I've also installed Ruby manually from source but this isn't recognised by the system and I can't switch versions.
If i run rbenv global it only recognises the System version of Ruby.
When I try brew upgrade ruby I get the following error:
ruby 2.5.3_1 already installed
If I try link to the new version with brew I get the following error:
brew link --force --overwrite ruby#2.5.3_1
Error: No such keg: /usr/local/Cellar/ruby#2.5.3_1
RVM doesn't install so I'm not sure what to do next. Below are the details of the packages I have installed.
Xcode 3.2.2 (I cant get an installer working for any higher versions of Xcode). The more recent versions hosted by Apple for Snow Leopard are corrupt when downloaded.
rbenv 1.1.1
brew 1.8.4
ruby 1.8.7 (System)
You have (or had) a path issue. Before you did your follow up steps, if you had run which ruby you'd probably see it pointing to /usr/bin/ruby which is system ruby, not your homebrew ruby in /usr/local/bin/ruby.
You still need to, if you haven't already, add your export command to your ~/.bash_profile file to ensure your PATH gets updated for every terminal window you open.
I'm not sure what actually fixed this but I ran the following commands after reading other posts and now have Jekyll 3.8.3 installed and ruby 2.5.3p105.
sudo chown -R "$USER":admin /usr/local
export PATH=/usr/local/bin:$PATH
brew link --overwrite ruby --force
gem install jekyll
When i install mac os sierra, trying install cocoapods, but appear error:
ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
but i already installed openssl and ruby,i really don't know is why,does anyone know?
Install Cocoapods by below 3 commands
sudo gem update --system -n/usr/local/bin
sudo gem install -n /usr/local/bin cocoapods
pod setup
I have Homebrew installed, I'm trying to install RVM with:
rvm install 1.9.3-head
and I get this error:
Installing required packages:gcc46
Error running 'requirements_osx_brew_libs_install gcc46',
please read /Users/mike/.rvm/log/1384918134_ruby-1.9.3-head/package_install_gcc46.log
Requirements installation failed with status: 1
brew doctor says I'm ready to brew.
In the log I see:
Error: Download failed: ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-4.3.2.tar.bz2
Ruby 1.9.3+ supports compiling with Clang (which you do have) instead of GCC, so make RVM compile with Clang instead:
rvm install 1.9.3 --with-gcc=clang
When I upgraded to mavericks from mountain lion it somehow started ignoring my dev-tools (like gcc, etc.) try
xcode-select --install
also see here
When upgraded to OSX 10.12 and installing ruby 2.3.1 these steps fixed the issue.
brew install homebrew/versions/gcc46
if there are any linking issues related to any lib please follow the instructions for example
brew link --overwrite libtool
brew link --overwrite libgpg-error
Once the installation of gcc46 is successful you could
rvm install 2.3.1