Need help. Having hard time installing cocoapods - installation

I am trying to install cocoapods onto my computer. I did the following:
sudo gem update--system
Password:
and I got the following text:
ERROR: While executing gem ... (Gem::CommandLineError)
Unknown command update--system
Kind of confused as to how to fix this.

If you are trying to update gems before installing cocoapods, you need to do
sudo gem update --system
You forgot the space between update and --system.
To install cocoapods, you need to use the following command:
sudo gem install cocoapods

Related

permission error when installing gem from terminal

I have been trying to install zsteg with the gem install command, but i get this error, even as a super-user:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
I have tried sudo gem install zsteg, sudo -s then gem install zsteg and just gem install zsteg, but none work. What should I do?
edit: I am using macOSX Mojave and I have ruby
I just reinstalled rake and zsteg and it worked for me.
1. make sure you have ruby-dev
2. update --system
3. sudo gem install rake
4. sudo gem install zsteg
good luck!
So I worked it out. I changed the install directory to /usr/local/bin using this:
gem install zsteg -n /usr/local/bin

Error occured while installing unf_ext (0.0.7.4), and Bundler cannot continue

My ultimate goal is to get this to work in an Ubuntu 14.04 Docker container: https://github.com/byalextran/autoluv
When I run
m1#9bdc67007b49:~/autoluv$ bundle install --deployment
It says:
Fetching unf_ext 0.0.7.4
Installing unf_ext 0.0.7.4 with native extensions
Errno::EACCES: Permission denied # rb_sysopen - /home/m1/autoluv/vendor/bundle/ruby/2.4.0/gems/unf_ext-0.0.7.4/.document
An error occurred while installing unf_ext (0.0.7.4), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.4' --source 'https://rubygems.org/'` succeeds before bundling.
But when I run
sudo gem install unf_ext -v '0.0.7.4' --source 'https://rubygems.org/'
unf_ext-0.0.7.4 installs fine?
Building native extensions. This could take a while...
Successfully installed unf_ext-0.0.7.4
1 gem installed
Installing ri documentation for unf_ext-0.0.7.4...
Installing RDoc documentation for unf_ext-0.0.7.4...
I cannot figure out the next step. I've tried installing ruby-dev and gcc, but neither has helped move this along :(
Any and all help is much appreciated!
I had this same problem and the reason was that I did not installed all the dependencies that bundler needs to run
just try to:
sudo apt-get install build-essential
then run again
gem install bundler
and lastly
bundler
There is a difference between running commands with sudo and without. You can get more info about this command here https://kb.iu.edu/d/amyi.
Errno::EACCES usually happens when bunder has no access to a needed folder or it doesn't exist.
Try to gem install unf_ext -v '0.0.7.4' --source 'https://rubygems.org/' without sudo.
I had same issue on Fedora.
I simply had to install the gcc-c++ package.
I solved this error on Debian 10 buster in my ChromeOS Linux container by installing rbenv: sudo aptitude install rbenv or sudo apt install rbenv.
Aptitude package manager seems to be better at resolving dependencies and allowing me to install newer packages more easily than the default apt so I thought it was worth mentioning.
Solved it after using following commands for Xcode 13, BigSur :
softwareupdate --install a
sudo port upgrade outdated
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wget
brew install build-essentials
bundler install
If you are an iOS developer who is getting this error, this might be related to your Xcode command line tools selection.
Just run the following command with the path of the Xcode that you are using currently.
sudo xcode-select --switch /Applications/Xcode.app
You need to use the latest version of Ruby.
If you are using MacOS, system Ruby is old and outdated. you can not update the system Ruby, but you can install another version of Ruby and make it default global using rbenv ruby version manager tool.
finally you can install any ruby packages you like.

Error for macos sierra install cocoapods

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

Ruby gems. Unable to add sources

I had this problem "https://stackoverflow.com/questions/19612185/unable-to-install-cocoapods-gem-from-rubygems-org-bad-response-backend-read-e" and as one of the solutions said I tried to remove/add rubygem sources. It was removed without problem, but when I tried to add it back it's giving me an error.
Here's my action on terminal and response:
$ gem sources --add https://rubygems.org/
Error fetching https://rubygems.org/:
server did not return a valid file (https://rubygems.org/specs.4.8.gz)
Does anyone know what is the problem?
Here is Easy Steps for installing Ruby in your system to help to install Cocoapods in your machine, I solved the same issue with being below mentioned steps.
Install command line tools using the command
xcode-select --install
Install Homebrew by
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Ruby using homebrew
brew install ruby
Check Ruby version
ruby -v
Install Ruby
gem source -a http://rubygems.org/
gem install cocoa pods
sudo gem install cocoapods
or
sudo gem install -n /usr/local/bin cocoapods
Go to below folder
cd ~/.cocoapods/repos
Run the below command
git clone https://github.com/CocoaPods/Specs.git master
Go to the directory where Podfile is present and run
pod install
Happy Coding😊
Steps:
1. sudo gem install cocoapods
2. pod install
3. pod update
ensure that you are connected to internet. Your system is unable to find the latest version of gems, required by pods

Unable to install 'cocoapods' gem from rubygems.org (bad response backend read error)

I'm getting an error when I run 'gem install cocoapods' on OSX Mavericks.
$ gem install cocoapods
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - bad response backend read error 503 (https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/cocoapods-0.27.1.gemspec.rz)
ERROR: Possible alternatives: cocoapods
Please note that I can download the cocoapods-0.27.1.gemspec.rz directly. I am running the latest version of XCode (5.0.1) and the latest version of its CLI tools. RVM is also configured to run the latest Ruby version (2.0.0p247)
Sometimes ,the default source for gem, https://rubygems.org/, can't be accessed.
It should be removed by command:
gem sources -r https://rubygems.org/
And then new source should be added:
gem sources -a https://ruby.taobao.org/
Update the cache:
gem sources -u
You can check sources with:
gem sources
Finally , you can install cocoapods:
sudo gem install cocoapods
Use the below mentioned steps to install Cocoapods in your machine,
I solved the same issue with be below mentioned steps
1.Install command line tools using the command
xcode-select --install
2.Install Home brew by
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3.Install Ruby using homebrew
brew install ruby
4.Check Ruby version
ruby -v
5.Install Ruby
gem source -a http://rubygems.org/
6.gem install cocoapods
sudo gem install cocoapods
or
sudo gem install -n /usr/local/bin cocoapods
7.Go to below folder
cd ~/.cocoapods/repos
8.Run the below command
git clone https://github.com/CocoaPods/Specs.git master
9.Go to the directory where Podfile is present and run
pod install
It work for me:
Remove https source by command:
gem sources -r https://rubygems.org/
And then new http source should be added:
gem sources -a http://rubygems.org/
Update the cache:
gem sources -u
Though I'm not sure what caused read error 503 I was able to work around the problem fairly easily by manually installing the cocoapods.gem.
If anyone else experiences similar problems (with cocoapods or any other gem), download the appropriate gem file (cocoapods-0.27.1.gem in my case) directly from RubyGems.org. Then run the gem install cocoapods-0.27.1.gem. The install command will scan the working directory first, thus detecting and installing the local gem package, cutting out the broken repository.
I found that just removing and re-adding rubygems seemed to work for me ( using the High Sierra on Mac) I prefer to use the official Rubygems repos
gem sources -r https://rubygems.org/
gem sources -a https://rubygems.org/
gem sources -u
sudo gem install cocoapods
I assume it must have been a glitch..
This worked for me. Make sure to include sudo with install command.
gem sources -a http://rubygems.org/
gem sources -u
sudo gem install cocoapods
Just follow there steps and error is gone
1.Install command line tools using the command
xcode-select --install
2.Install Home brew by
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
3.Install cocapods using home-brew, it take care of everything
brew install cocoapods
4. Last step
pod setup
For me I had to change rubygems.org to be the gems url used at my company (which caches from rubygems.org).
I did sudo gem install cocoapods --source <my_company_url_for_gems>
Let all http replace https,because the right cocoa pods's sources is https://ruby.taobao.org/

Resources