0

Short and sweet: I recently upgraded to MacOS Catalina and Xcode 12 which broke my cocoapods install. Attempting to repair resulted in a possible scenario warranting a complete OS (or Xcode?) reinstall. I cannot get rubygems to allow for any source provider. I'm hoping to avoid the full reinstall of either the OS or Xcode.

Long version: After upgrading to MacOS Catalina and Xcode 12, my cocoapods installation for a local project yielded

Pod failure for arm64 (ArcGIS):
ld: building for iOS Simulator, but linking in dylib built for iOS, file '/<removed>/Pods/ArcGIS-Runtime-SDK-iOS/ArcGIS.framework/ArcGIS' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Attempting to re-install cocoapods with gem install cocoapods yielded:

-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory

I tried with both user and root level permissions. This sent me to Facing issue - bad interpreter: No such file or directory when used pod update on MAC

From there, I ended up upgrading rubygems manually. Once upgraded to 3.1.4, I again attempted to install cocoapods:

02:56:46$ sudo gem install cocoapods
ERROR:  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/specs.4.8.gz)

which led med down the wrong path of "they're still using TLS 1/SSLv3", do the following at https://stackoverflow.com/a/51015358 and https://stackoverflow.com/a/19179835. After using my own openssl s_client -connect rubygems.org:443 test I determined the SSLv3/TLSv1 issue to have been addressed. Regardless, I forced an IPv4 entry for rubygems.org in my /etc/hosts settings and removed the https://rubygems.org/ source link to drop in the insecure http://rubygems.org/ to do the update. And here's the break: I cannot figure out how to force it to allow me to re-add the https://rubygems.org/ source or even the insecure http://rubygems.org/ source

See the below terminal output which shows I can fully access the specs.4.8.gz from rubygems.org (no networking issue) and cannot re-add the sources link:

Desktop  04:08:17$ curl -s -o specs.4.8.gz https://rubygems.org/specs.4.8.gz
Desktop  04:08:32$ ls | grep specs
specs.4.8.gz
Desktop  04:08:37$ gem sources -l
*** CURRENT SOURCES ***

Desktop  04:08:54$ gem sources -a https://rubygems.org
https://rubygems.org is too similar to https://rubygems.org

Do you want to add this source? [yn]  y
Error fetching https://rubygems.org:
    no such name (https://rubygems.org/specs.4.8.gz)
Desktop  04:09:02$ gem sources -a https://rubygems.org/
https://rubygems.org/ is too similar to https://rubygems.org

Do you want to add this source? [yn]  y
Error fetching https://rubygems.org/:
    no such name (https://rubygems.org/specs.4.8.gz)
Desktop  04:09:15$ gem sources -l
*** CURRENT SOURCES ***

Desktop  04:15:57$ gem sources -a http://rubygems.org/
https://rubygems.org is recommended for security over http://rubygems.org/

Do you want to add this insecure source? [yn]  y
http://rubygems.org/ is too similar to https://rubygems.org

Do you want to add this source? [yn]  y
Error fetching http://rubygems.org/:
    no such name (http://rubygems.org/specs.4.8.gz)
Desktop  04:19:00$ gem sources -l
*** CURRENT SOURCES ***

Desktop  04:19:06$ ping rubygems.org
PING rubygems.org (151.101.128.70): 56 data bytes
64 bytes from 151.101.128.70: icmp_seq=0 ttl=57 time=29.700 m

Desktop  04:21:00$ ls -alrt | grep spec
-rw-r--r--   1 <removed>  staff   4254166 Oct 13 16:08 specs.4.8.gz

I am baffled by the issue of

no such name (https://rubygems.org/specs.4.8.gz)

given my ability to pull it using curl with no issue. I have tried removing the IPv4 entry from my /etc/hosts location, disabled IPv6 in my wireless, enabled IPv6 in my wireless. I am simply unable to force rubygems to re-enable the https://rubygems.org/ source.

Versions:

Desktop  04:15:16$ ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
Desktop  04:15:19$ gem --version
3.1.4
Desktop  04:15:23$ gem sources -l
*** CURRENT SOURCES ***

Desktop  04:15:30$ gem install cocoapods
ERROR:  Could not find a valid gem 'cocoapods' (>= 0) in any repository
Desktop  04:15:53$ uname -a
Darwin <Removed>.local 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_6

My final attempt to repair (so far) was to re-install the rubygems again.

rubygems-3.1.4  04:29:28$ ruby setup.rb
ERROR:  While executing gem ... (Errno::EROFS)
    Read-only file system @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/gem
rubygems-3.1.4  04:29:30$ sudo ruby setup.rb
Password:
ERROR:  While executing gem ... (Errno::EROFS)
    Read-only file system @ rb_sysopen - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/gem

So now, I can't even re-install ruby gems, let alone re-add the rubygems.org sources.

Zach
  • 1
  • 1

1 Answers1

0

After re-installing Ruby using rvm, and re-installing Xcode and encountering the same issue, I finally figured it out. It did not dawn on me that root was working and my local user was not. The problem was that I had disconnected from corporate network to do the installs, but was still configured to use the corporate proxy settings in my local user, and not in root.

Basically, undo the settings in https://stackoverflow.com/a/48824738/14444903

vi ~/.gemrc
Zach
  • 1
  • 1