Cocoapods unable to download data from ruby [duplicate] - ruby

This question already has answers here:
Cannot install any ruby gems on Mac OS - SSL_connect error
(3 answers)
Closed 4 years ago.
Im very new to Xcode and im trying to get firebase but cocoapods wont install. Whenever I type gem install cocoapods or sudo gem install cocoapods I get this...
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version (https://rubygems.org/latest_specs.4.8.gz)
Im pretty sure I have the latest version of ruby (2.0.0), Xcode 8.2, and im running MacOS 10.11.6 El Capitan on a mid2007 IMac. Im not sure if my computer is outdated and cant download it.
I haven't found any clear answers anywhere else other than try putting sudo in front of gem so any help is appreciated. Sorry in advanced if this question has been asked or if its a very simple fix, I am very new to xcode and coding in general.

I wanted to leave this question up in case anyone else who is new wanted an easy answer. I also added this as a duplicate question to one with a more in depth answer I think.
How I fixed my problem:
I installed homebrew https://brew.sh/
Then I used homebrew to install rbenv with brew install rbenv
Once I had rbenv I downloaded 2.0.0-dev instead of 2.0.0 and used rbenv local 2.0.0-dev to set it as my main ruby version.
Then I opened a new terminal and proceeded as normal by installing cocoapods and installing a podfile into my xcode.

Related

How do I nuke RubyGems and start again from scratch?

I've been trying to update cocoapods on my laptop this evening and I'm getting a weird RubyGems error...
With the following command...
sudo gem install cocoapods
I got the following error.
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version (https://rubygems.org/latest_specs.4.8.gz)
Not sure where to go from here. This used to work (two weeks ago) and the only reference I found online was from 4 years ago.
I tried updating gems gem update --system but it told me I'm on the latest version.
I can list gems and uninstall them. I just can't install them?
Oh man. I managed to get it to update with sudo and now with...
sudo gem install cocoapods
I get the error...
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj
No idea what that means?!
Oh god! OK, so I followed the advice here... https://github.com/CocoaPods/CocoaPods/issues/3692
And pod init worked. But when I restarted terminal it now says pod: command not found.
How do I nuke ruby gems and start again?

Error while installing cocoa pods on macbook with Yosemite 10.10.5

I am trying to install cocoa pods on macbook which is running Yosemite 10.10.5, and also this macbook is provided by my company so its having some security.
When I run "sudo gem install cocoapods" command in terminal, i am getting following
Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)
I tried all the solution provide on almost every post but i didn't get the solution. Please help he on this.

Error: SASS installation for windows

am trying to install sass after installing ruby, but iam getting following error, please help me to fix this
maradhak#WW730VW7X1688 /c/softwares
$ gem -v
2.2.2
maradhak#WW730VW7X1688 /c/softwares
$ gem install sass
ERROR: Could not find a valid gem 'sass' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://rubygems.org/latest_specs.4.8.gz)
The error has something to do with being vulnerable to the Poodle SSL bug, it will not be verified for that reason. If there's a way to upgrade to a better certificate, but at the time of writing this answer, I could not find the upgraded certificate.
I used the non-SSL host instead, altough I should note that this is not the best nor a permanent solution, it lacks security.
The command used:
gem source -a http://rubygems.org/
A discussion about this subject can be found here: https://github.com/rubygems/rubygems/issues/515#issuecomment-65326585
Update: There seems to be a permanent solution now, which replaces the certificate with a proper protected one. It can be found on the following URL, an tutorial is included in that page.
https://gist.github.com/luislavena/f064211759ee0f806c88#installing-using-update-packages-new
Short answer:
gem sources -a http://rubygems.org/
Confirm than you don't really care about that specific warning, since you trust rubygems.org. Then:
gem install sass
And it works.
thanks for your suggestions, as you guys said this seems to be SSH update issue.
have solved this issue simply down graded my RUBY version from "2.1.5" to "1.8", and the gem version is "1.8.29".
then i was able to install SASS
Following worked for me:
Remove the https source temporary, run gem update --system and then switch back to https.
gem sources --remove https://rubygems.org/
gem sources --add http://rubygems.org
gem update --system
gem sources --remove http://rubygems.org
gem sources --add https://rubygems.org
Ref: https://github.com/rubygems/rubygems/issues/1736
I also encountered the same problem today。
Running gem install sass returned
ERROR: Could not find a valid gem 'sass' (>= 0), here is why:Unable to download data from https://rubygems.org/ -SSL_connect returned=1 errno=0 state=SSLv3read server certificate B: certificate verify failed(https://api.rubygems.org/specs.4.8.gz)
Then I find a way to fix it:
gem sources -a http://rubygems.org/
gem install sass
Adding http://rubygems.org/ to sources solves this.
Here is a capture of my terminal
For me it was a proxy issue. When I appended the proxy details to the gem install command it worked.
gem install sass --http-proxy=http://<yourproxy>:<port>
The first step to Rubygems(http://rubygems.org/) then download sass on(http://rubygems.org/gems/sass)
put in: npm install
You don't need to disable SSH or downgrade your ruby version, you can simply install the SASS gem manually. Here's how to do it:
On windows, first install the Ruby installer for windows.
Download the latest version of the gem from here:
https://rubygems.org/gems/sass Click the latest version, and then on
the right side of the screen (in Links section) click the "Download"
link to download the original gem file (sass-*.*.*.gem)
Now paste the downloaded gem file to the directory that ruby is
installed on: C:\Ruby22-x64\bin\sass-*.*.*.gem
In Command Prompt run the following commands:
cd C:Ruby22-x64/bin
gem install sass-*.*.*.gem1
NOTE: You may also need to call the local flag while installing the gem: gem install --local C:Ruby22-x64/bin/sass-*.*.*.gem
Install a full fledged Cygwin on your windows, the ssh support is good in it. You should be able to install it without any extra efforts, well I always do. In fact once you have Cygwin install you would hardly use the command prompt.
I'm totally new to Ruby and Sass. I didn't want to risk security and I'm on a Windows machine. I had already installed latest ruby, but kept getting the same error message as the OP when trying to run gem install sass at the command prompt.
Here's what solved the problem for me.
Go to: https://rubygems.org/pages/download and follow the instructions on the page starting here (for manual installation):
If you don't have any RubyGems installed, there is still the pre-gem approach to getting software, doing it manually:
Download from above (URL above)
Unpack/unzip into a directory and cd there (into the directory you unzipped it)
Install with: ruby setup.rb (at the command line type that command. You may need admin/root privilege)
After I installed ruby gems, I opened Ruby command prompt (using Start Command Prompt with Ruby from the start menu) and ran the command gem install sass and it worked:
C:\Users\chris>gem install sass
Fetching: sass-3.4.22.gem (100%)
Successfully installed sass-3.4.22
Parsing documentation for sass-3.4.22
Installing ri documentation for sass-3.4.22
Done installing documentation for sass after 36 seconds
1 gem installed
Wanted to detail it as much as possible for other newbies like me. Hope this helps someone.
Changing from http to https makes your computer vulnerable to hackers
I explain some solutions in my answer here: https://stackoverflow.com/a/40075753/845413
If you found this error by searching and are using RVM on OSX just run.
rvm osx-ssl-certs update all
Bundler outlines a few other solutions in their troubleshooting guide for this error: http://bundler.io/v1.16/guides/rubygems_tls_ssl_troubleshooting_guide.html#troubleshooting-certificate-errors
and include...
gem install bundler
gem update --system
Finally, you can simply reinstall RVM or rubygems manually.
Manually install Ruby gems: https://rubygems.org/pages/download
Manually install RVM (recommended): http://rvm.io/

Unable to install heroku gem on ruby 1.8.6

I’m facing trouble trying to install the latest version of heroku gem (gives me an “abort trap” message). Currently it’s 2.17.0.
I’ve been able to install 2.3.6, and nothing greater (from 2.4 up I receive the “abort trap” message).
I’m using OS X Snow Leopard.
If you are using RVM, the abort trap message is due wrong compiler being used to compile your Ruby installation. Take a look at Why can't I install Rails on Lion using RVM? to find your answer

sqlite3 gem on Mac OS X Lion... fail!

I just upgraded my Mac to Lion but unfortunately I had to re-setup my Rails development environment. With the following versions of software:
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
Rails 3.0.9
sqlite3 3.7.5
When I run the command:
sudo gem install sqlite3
It throws following exception:
ERROR: Error installing sqlite3:
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
And the it adds:
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out
Did anyone dive into Lion yet..
Thanks
I was having problems with this. I downloaded the Xcode from Apps store and it still didn't work. I reinstalled Xcode 3.2 and still nothing. Then I read a post that said that downloading Xcode and installing it were different. I went the Applications and ran the Xcode installer and after that everything worked fine.
I had this problem too and realised installing XCode is not enough, following installation you need to go into XCode -> Preferences -> Download, and install the Command Line Tools. This installs GCC.
I've always had problems with OS X's built in Ruby. Use RVM. Helps Ruby devs manage their Ruby versions and libraries. Definitely recommended. Then from there, install your gems.
Install Guide: http://beginrescueend.com/rvm/install/
Edit: You won't even need to sudo anymore since everything is in your home directory hidden.
Installing Xcode didn't do the trick for me. Instead, I installed Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
Then installed sqlite with Homebrew:
brew install sqlite
And then finally ran:
sudo bundle install
within my Rails app, which successfully installed Sqlite
updated Xcode for Mac OS X Lion and sqlite3 gem installed without any trouble... So I think whenever anyone upgrades their Mac OS, the first thing they should do is update Xcode after the upgrade...
If upgrading to Lion, the first thing I would recommend is downloading and INSTALLING the new Xcode (4.2) from the Apple website. I know this is in regards to rails, but I like having Xcode for messing with Iphone and Ipad applications (granted I'm not very good at it...yet).
Then, you will want to download the GCC installer:
github.com/kennethreitz/osx-gcc-installer/downloads. Download the latest one.
This is somewhat of a replacement for Xcode and it will tell you that you can uninstall Xcode after this install is finished. That's up to you: I did not uninstall Xcode afterwards.
To test it out if it made an impact, I created a rails new appname in my terminal. The bundle worked fine, before it did not. There was an issue with gem install json -v '1.6.5'
Fwiw I'm currently in Chapter 9 of the Hartl tutorial and was working in rails 3.1, Snow Leopard OS X Before today.
Hope this helps!
I just upgraded to Maverick and had trouble with a few gems.
Go to Apple Developer Downloads and pickup Command Line Tools (OSX Mavericks) for Xcode.
After installation, I was able to bundle sqlite3 and pg gems.
For those still having issues installing sqlite3 gem in Mavericks:
sudo xcode-select --reset
xcode-select manual says, the reset option
Unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism.
By the way, this happened to me while migrating from Snow Leopard to Mavericks. I think the issue was with the developers tool path, which is different in each of these operating systems.

Resources