install cocoapods failed on mac - ruby

I tried to install cocoapods on mac according to the instructions http://cocoapods.org/ , but got the error as below:
$sudo gem install cocoapods
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
bad response Service Unavailable: Back-end server is at capacity 503 (https://api.rubygems.org/api/v1/dependencies?gems=cocoapods)
but sometimes, the error message is different。
$ sudo gem install cocoapods
Password:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
rake RUBYARCHDIR=/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-12/1.9.1/xcodeproj-0.17.0 RUBYLIBDIR=/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-12/1.9.1/xcodeproj-0.17.0/Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'rake' (>= 0) among 20 total gem(s) (Gem::LoadError)
from /Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:309:in `to_spec'
from /Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /Users/tap4fun/.rvm/gems/ruby-1.9.3-p484/bin/rake:22:in `<main>'
from /Users/tap4fun/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
from /Users/tap4fun/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'
rake failed, exit code 1
Gem files will remain installed in /Users/tap4fun/.rvm/rubies/ruby-1.9.3- p484/lib/ruby/gems/1.9.1/gems/xcodeproj-0.17.0 for inspection.
Results logged to /Users/tap4fun/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/gems/1.9.1/extensions/x86_64-darwin-12/1.9.1/xcodeproj-0.17.0/gem_make.out
ruby version: 1.9.3
rake version: 10.2.2

Try this (Worked for me with OSX 10.10)
Open Xcode 6
Open Preferences
Click the Locations tab
Change the Command Line Tools version to Xcode 6.0
Uninstall cocoapods
$ sudo gem uninstall cocoapods
Install xcodeproj
$ sudo gem install xcodeproj
Install cocoapods
$ sudo gem install cocoapods
Run pod --version to verify

Related

Could not find gem 'xcode-install' in any of the gem sources listed in your Gemfile or in gems cached in vendor/cache

when I use this command to run fastlane:
bundle exec fastlane beta
shows error:
~/Documents/GitHub/cruise-open/ios on  main! ⌚ 14:59:47
$ bundle exec fastlane beta ‹ruby-3.0.0›
Could not find gem 'xcode-install' in any of the gem sources listed in your Gemfile or in gems cached in vendor/cache.
Run `bundle install` to install missing gems.
(base)
then I install xcode-install like this:
$ gem install xcode-install ‹ruby-3.0.0›
Fetching xcode-install-2.6.8.gem
Successfully installed xcode-install-2.6.8
Parsing documentation for xcode-install-2.6.8
Installing ri documentation for xcode-install-2.6.8
Done installing documentation for xcode-install after 0 seconds
1 gem installed
(base)
still not fix this problem. what should I do to fix it?
In your Gemfile you need to add this line:
gem "xcode-install"
Right after
gem "fastlane"
And run fastlane command again.

Error installing compass in OSX Yosemite (or Sierra)

Good day
I have a Mac with OSX Yosemite
I'm trying to install the compass with the command:
sudo gem install compass
but I am getting the following error:
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20151001-1122-1jqcu8r.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/ffi-1.9.10/gem_make.out
before attempting to install the package I updated the gem with the command
sudo gem update --system
and the update occurred without errors
You probably need to install the command line developer tools first.
xcode-select --install
Then try sudo gem install compass again

How do I install a cocoapod in mavericks with ruby and Command Line Tools correctly?

This is my setup:
Mavericks 10.9.1
Xcode 5.0.2
which ruby returns this:
/Users/quique123/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
but dvm install ruby returns:
Already installed ruby-2.1.0.
To reinstall use:
rvm reinstall ruby-2.1.0
So doesn't this mean I have ruby 2.1.0?
gems list says I have installed cocoa pods & cocoapods-core 0.29.0 and some other gems.
After sudo gem install cocoa pods I get the bunch of fetches and change log and Successfully Installed cocoa pods 0.29.0. It then parses and installs documentation and when I run pod setup I got:
Setting up CocoaPods master repo
Setup completed (read-only access)
So I created a file from a tutorial:
platform :iOS, '7.0'
pod 'Mantle'
pod 'TSMessages'
pod 'ReactiveCocoa'
but when I run pod install I get:
/Users/myusername/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'cocoa pods' (>= 0) among 37 total gem(s) (Gem::LoadError)
from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:309:in `to_spec'
from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/bin/pod:22:in `<main>'
How do I get the pod to install correctly and why am i getting messages of ruby 1.9.3?
If you have rvm installed do not use sudo gem install cocoapods. It creates problems. Follow these steps to fix your cocoapods installation:
Uninstall Cocoapods:
sudo gem uninstall cocoapods
Make sure you're on the latest Ruby:
which ruby
Install cocoapods without sudo:
gem install cocoapods -V --no-ri --no-rdoc
# V: Verbose; no-ri,no-rdoc: Do not install documentation
Set up Cocoapods:
pod setup
Should work now.

Error while installing cocoapods

This is happening:
Mac:~ Swanros$ sudo gem install cocoapods
+Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
rake RUBYARCHDIR=/Users/Swanros/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/xcodeproj-0.14.0/ext RUBYLIBDIR=/Users/Swanros/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/xcodeproj-0.14.0/ext
/Users/Swanros/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'rake' (>= 0) among 9 total gem(s) (Gem::LoadError)
from /Users/Swanros/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /Users/Swanros/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /Users/Swanros/.rvm/gems/ruby-2.0.0-p247/bin/rake:22:in `<main>'
Gem files will remain installed in /Users/Swanros/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/xcodeproj-0.14.0 for inspection.
Results logged to /Users/Swanros/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/xcodeproj-0.14.0/ext/xcodeproj/gem_make.out
Mac:~ Swanros$
How could I solve this? I'm running OS X Mavericks with Xcode 5 Command Line Tools already installed.
I’ve just released xcodeproj 0.14.1 which contains a fix for this: https://github.com/CocoaPods/Xcodeproj/blob/0.14.1/CHANGELOG.md.
It should work if you try it again, or you can install the xcodeproj gem first and then try again:
$ sudo gem install xcodeproj
$ sudo gem install cocoapods
After updating Xcode 5 to Xcode 5.0.1, cocoapods can be installed successfully

error while installing fastthread from ruby gem . How to remove the error?

gem install fastthread -v1.0.7
Building native extensions. This could take a while...
ERROR: Error installing fastthread:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:8:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:8
Gem files will remain installed in /var/lib/gems/1.8/gems/fastthread-1.0.7 for inspection.
Results logged to /var/lib/gems/1.8/gems/fastthread-1.0.7/ext/fastthread/gem_make.out
This is what I got when I tried installing from fastthread to set up SUP mail client on my system . How to get rid of this error?
Install these and then try re-installing:
sudo apt-get install ruby1.8-dev
Try this link http://kenno.wordpress.com/2009/07/25/fixed-extconf-rb8in-require-no-such-file-to-load-mkmf-loaderror/
I was getting this same error in OS X Lion. Having Xcode 4.3 installed doesn't cut it. You have to go to preferences in Xcode and install the command line tools, which installs the necessary compiler tools for doing native builds on the system. After I did this, then gem install fastthread worked for me.
Just to add to this, on debian and ubuntu the "complete" ruby package is this:
ruby1.8 ruby1.8-dev ri1.8 rdoc1.8 irb1.8 ruby1.8-elisp
ruby1.8-examples libdbm-ruby1.8 libgdbm-ruby1.8 libtcltk-ruby1.8
libopenssl-ruby1.8 libreadline-ruby1.8
So something like
sudo aptitude install ruby1.8 ruby1.8-dev ri1.8 rdoc1.8 irb1.8 ruby1.8-elisp ruby1.8-examples libdbm-ruby1.8 libgdbm-ruby1.8 libtcltk-ruby1.8 libopenssl-ruby1.8 libreadline-ruby1.8
Will save you a lot of time when doing bundle install on a large project.

Resources