When I try to run “pod install" in the terminal, I get this same error for all my projects. Last time a complete brew update was performed.
robajz#Roberts-MacBook-Pro ios % pod install
[!] Invalid `Podfile` file:
[!] Invalid `RNGestureHandler.podspec` file: undefined method `exists?' for File:Class.
# from /Users/robajz/Projects/shop8-mobile-app/node_modules/react-native-gesture-handler/RNGestureHandler.podspec:5
# -------------------------------------------
#
> isUserApp = File.exists?(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json"))
# if isUserApp
# -------------------------------------------
.
# from /Users/robajz/Projects/shop8-mobile-app/ios/Podfile:10
# -------------------------------------------
# target 'Shop8App' do
> config = use_native_modules!
#
# -------------------------------------------
So after much pain, i found that if I added this line into the .podspec where the error was coming from
print RUBY_VERSION
It was printing out 3.2.0 which I believe has deprecated the "exists" method as mentioned in the error, but I was using a .ruby-version file and rbenv as suggested in the docs and ruby -v was printing out 2.7.5 as expected.
After hunting through my file system to find where this v3.2.0 could possibly be installed I tried downgrading cocoapods from 1.11.3 -> 1.11.2 and it instantly solved my issue and the print in the podspec was now printing 2.7.5
Related
I encountered this error
2023-01-24T22:14:41.500565325Z Installing ri documentation for cocoapods-catalyst-support-0.2.1
2023-01-24T22:14:41.500827390Z Done installing documentation for colored2, concurrent-ruby, i18n, tzinfo, zeitwerk, activesupport, nap, fuzzy_match, httpclient, algoliasearch, ffi, ethon, typhoeus, netrc, public_suffix, addressable, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-trunk, cocoapods-try, molinillo, atomos, nanaimo, rexml, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods, cocoapods-catalyst-support after 50 seconds
2023-01-24T22:14:41.500997230Z 35 gems installed
2023-01-24T22:14:42.023353910Z [in /Volumes/workspace/repository]
2023-01-24T22:14:42.023798292Z
2023-01-24T22:14:42.024448317Z [!] Invalid `Podfile` file: cannot load such file -- cocoapods-catalyst-support.
2023-01-24T22:14:42.024714192Z
2023-01-24T22:14:42.024976712Z # from /Volumes/workspace/repository/Podfile:1
2023-01-24T22:14:42.025200239Z # -------------------------------------------
2023-01-24T22:14:42.025463448Z > require 'cocoapods-catalyst-support'
2023-01-24T22:14:42.025663811Z #
2023-01-24T22:14:42.025900158Z # -------------------------------------------
from my post-clone script in the Xcode Cloud temporary build environment, which is
#!/bin/sh
# ci_post_clone.sh
export GEM_HOME="$HOME/.gem"
gem install bundler
brew install cocoapods
gem install cocoapods-catalyst-support
# Install dependencies managed with CocoaPods.
pod install
I tried Github pages on Friday and found it great so decided to install Jekyll locally (Windows 10) so I could build and test offline. After spending almost a day and trying multiple recipes (from theserverside.com, jekyllrb.com, etc) for how to install Jekyll I finally got jekyll -v to work. (Note that the instructions I found weren't bad but probably just out of date. People need to updates their blogs, or better people should stop changing how things are set up!)
However, now when I try to serve a test site I get a Segmentation fault (as below). I have tried starting again from scratch several times and even strangely get different results but have never gotten as far as serving the site.
$ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]```
$ jekyll -v
jekyll 4.2.2
$ jekyll new myblog
...
$ cd myblog
$ bundle exec jekyll serve
Configuration file: e:/Work/tmp/Daily/blog/myblog/_config.yml
Source: e:/Work/tmp/Daily/blog/myblog
Destination: e:/Work/tmp/Daily/blog/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/lib/sassc/engine.rb:43: [BUG] Segmentation fault
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
-- Control frame information -----------------------------------------------
c:0033 p:---- s:0182 e:000181 CFUNC :compile_data_context
c:0032 p:0314 s:0177 e:000176 METHOD C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/sassc-2.4.0/lib/sassc/engine.rb:43
...
[+576 more lines of backtrace and runtime info - available on request]
Thanks for any help you can give me to get Jekyll working.
BTW I don't like to complain but getting Ruby and Jekyll installed and running has been a royal pain. Maybe I have been spoilt with Go which literally took less than 10 minutes to install and have a running program (though calling C from Go (using CGO) took me a few hours to get working). Moreover, if Jekyll was written in Go it would a simple matter of downloading a single jekyll.exe - ie a few minutes instead of days (or however long it takes to get this working).
Update: I have tried lots of things with varying results but I never get as far as Jekyll serving the site. I don't know enough about Ruby and/or understand what the error messages mean to try to fix these things so I have now taken to documenting exactly what I tried and the result. Here are the last 4 things I tried and the result:
================================
Using Ruby 3.1.2.1 + Devkit (x64) and following instructions at https://jekyllrb.com/docs/installation/windows/ which run without error but then serving a test site has an error:
$ jekyll -v
jekyll 4.2.2
$ jekyll new myblog
...
New jekyll site installed in D:/myblog.
$ cd myblog
$ bundle exec jekyll serve
Configuration file: D:/myblog/_config.yml
Source: D:/myblog
Destination: D:/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 1.829 seconds.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for 'D:/myblog'
------------------------------------------------
Jekyll 4.2.2 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `require':
cannot load such file -- webrick (LoadError)
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:179:in `require_relative'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:179:in `setup'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:100:in `process'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `each'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/jekyll-4.2.2/exe/jekyll:15:in `<top (required)>'
from C:/Ruby31-x64/bin/jekyll:32:in `load'
from C:/Ruby31-x64/bin/jekyll:32:in `<main>'
=======================================
Using Ruby 3.1.2-1 and following instructions at https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/jekyll-install-windows-example-blog-tutorial after a lot of trial and error I eventually got jekyll serve to run but it said "generating feed" then stopped and there was no server running at http://localhost:4000.
=======================================
Using Ruby 3.0.4-1 (x64) and following instructions at https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/jekyll-install-windows-example-blog-tutorial I get to the very end but when I try to serve the a test site I get:
$ bundle exec jekyll serve
Configuration file: D:/myblog/_config.yml
Source: D:/myblog
Destination: D:/myblog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 0.758 seconds.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for 'D:/myblog'
------------------------------------------------
Jekyll 4.2.2 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-4.2.2/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
...
===================================
Using Ruby 2.7.0.1 and following instructions at https://gist.github.com/arthurattwell/281a5e1888ffd89b08b4861a2e3c1b35 I get as far as the ridk install and which fails:
$ ridk install
...
Which components shall be installed? If unsure press ENTER [1,2,3]
> sh -lc true
MSYS2 seems to be properly installed
Remove catgets to avoid conflicts while update ...
> pacman -Rdd catgets libcatgets --noconfirm
error: target not found: catgets
error: target not found: libcatgets
MSYS2 system update (optional) part 1 ...
> pacman -Syu --needed --noconfirm
:: Synchronizing package databases...
mingw32 is up to date
mingw64 is up to date
ucrt64 is up to date
clang32 is up to date
clang64 is up to date
msys is up to date
:: Starting core system upgrade...
there is nothing to do
:: Starting full system upgrade...
there is nothing to do
MSYS2 system update (optional) succeeded
MSYS2 system update (optional) part 2 ...
> pacman -Su --needed --noconfirm
:: Starting core system upgrade...
there is nothing to do
:: Starting full system upgrade...
there is nothing to do
MSYS2 system update (optional) succeeded
Install MSYS2 and MINGW development toolchain ...
> pacman -S --needed --noconfirm autoconf autoconf2.13 autogen automake-wrapper automake1.10 automake1.11 automake1.12 automake1.13 automake1.14 automake1.15 automake1.6 automake1.7 automake1.8 automake1.9 diffutils file gawk grep libtool m4 make patch pkg-config sed texinfo texinfo-tex wget mingw-w64-x86_64-binutils mingw-w64-x86_64-crt-git mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-libs mingw-w64-x86_64-headers-git mingw-w64-x86_64-libmangle-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-make mingw-w64-x86_64-pkg-config mingw-w64-x86_64-tools-git mingw-w64-x86_64-winpthreads-git
error: target not found: automake1.10
error: target not found: automake1.6
error: target not found: automake1.7
error: target not found: automake1.8
error: target not found: automake1.9
warning: file-5.41-4 is up to date -- skipping
warning: gawk-5.1.1-1 is up to date -- skipping
warning: grep-1~3.0-3 is up to date -- skipping
warning: sed-4.8-3 is up to date -- skipping
warning: wget-1.21.3-1 is up to date -- skipping
Install MSYS2 and MINGW development toolchain failed
Installation failed: pacman failed
I got it to work using the instructions at www.theserverside.com and installing Ruby 2.7.6
Note that the install of Ruby messed with msys/mingw and now when I try to debug my Go program I get this error:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../lib/libmsvcrt.a(/359): duplicate symbol reference: _unlock_file in both libgcc(.text) and libgcc(.data)
libgcc(.text): relocation target ___chkstk_ms not defined
libgcc(.text): relocation target atexit not defined
but I guess that is a new question
I see many, many instances of similar issues related to recent Mac OS/xCode updates with multitudes of proposed solutions that seem to work as often as not. So far, none have worked for me. Here's what i'm seeing.
I have a long-standing xCode project with cocoapods. A second developer did some updates on a different system which resulted in build errors reading:
"The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation."
When I use the terminal to attempt "pod init, pod update, pod install, pod deintegrate etc... I get:
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
The actual Ruby version that exists on my machine is 2.6, not 2.3
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby:
There is no folder on my machine located at
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby:
$ which ruby says: /usr/bin/ruby
That file does exist.
Multiple sources say that ruby installed by HOMEBREW would be found at:
/usr/local/opt/ruby/bin/ruby
There is currently no alias for Ruby in that location.
/usr/local/opt is full of folder aliases but there is no "ruby" alias
I've deleted & reinstalled the xCode commandline tools but when I try to do basically anything with homebrew (brew doctor, brew update, brew upgrade etc...)I get errors like this:
Mainframe:~ username$ brew -v
Homebrew 0.9.5
Mainframe:~ username$ brew upgrade
Traceback (most recent call last):
4: from /usr/local/Library/brew.rb:31:in `<main>'
3: from /usr/local/Library/Homebrew/os/mac.rb:15:in `version'
2: from /usr/local/Library/Homebrew/os/mac.rb:15:in `new'
1: from /usr/local/Library/Homebrew/os/mac/version.rb:24:in `initialize'
/usr/local/Library/Homebrew/version.rb:176:in `initialize': Version value must be a string (TypeError)
All of this started (apparently) because something is different on the other developers machine. I've been chasing this issue around in circles for days and getting nowhere.
Having done all of this, I'm thinking the problem lies somewhere back at the beginning with my machine looking for a Ruby 2.3 that does not exist rather than the 2.6 that DOES exist but I have no clue how to tell for sure or how to fix it.
Any help would be greatly appreciated.
Solution: Hack the pod file
Short version:
1.) Open the file at usr/local/bin/pod
2.) Change 2.3 to 2.6 in the top line
Long version:
There is an executable file located at: usr/local/bin/pod
The contents are as follows:
#!/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'cocoapods' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
load Gem.bin_path('cocoapods', 'pod', version)
I opened the file at: usr/local/bin/pod
and edited the first line to change 2.3 to 2.6.
This had some effect. Now if I cd into my xcode project and try to run "pod update" I get a different error.
Mainframe:graffwriter username$ pod update
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/rbconfig.rb:229: warning: Insecure world writable dir /Users/pilotrase/bin/FDK/Tools/osx in PATH, mode 040777
Traceback (most recent call last):
2: from /usr/local/bin/pod:22:in `<main>'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:262:in `bin_path'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
The pods now seem to be missing...
I ran:
sudo gem install -n /usr/local/bin cocoapods
It seems to have worked.
I ran:
pod update
It seems to have worked.
I opened the xCode project and ran a build. The error no longer occurred and the build succeeded.
The actual Ruby version that exists on my machine
Actually, that’s the source of the problem. Under no circumstances should you use the system ruby! Use rbenv to take control of your ruby versions.
sudo gem install ...
Blap! Game over, thank you for playing. The fact that you have to say sudo is a major giveaway. This will lead to huge trouble later. Again, this is because you’re using the evil system ruby. This was always wrong. It is not intended for public use! Use rbenv and never say sudo again.
I am getting the following error
using ruby 1.9.3
gem install rails --version=4.0.0
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `read': Permission denied - /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/specifications/multi_json-1.8.4.gemspec (Errno::EACCES)
This is what I got from support:
"That is indeed a deployment regression that went with our latest release that's causing this issue and break new workspace creations.
We have a fix for it that should be in production in 12 hours from now.
However, a workaround would be to separate your ruby workspace's environment from our shared space installation:
edit ~/.bashrc adding the line to the end of the file (using nano or vim):
export GEM_PATH=$HOME/lib/ruby/gems
Then:
$ source ~/.bashrc
$ gem install rails -v 3.2.16
$ bundle install
I am trying install devkit on windows 7 but getting below error while issuing command
ruby dk.rb install.
[INFO] Skipping existing gem override for 'C:/RailsInstaller/Ruby1.9.3'
[WARN] Skipping existing DevKit helper library for 'C:/RailsInstaller/Ruby1.9.3'
So i tried >ruby dk.rb install --force but now i am getting this error,
[WARN] Updating (with backup) existing gem override for 'C:/RailsInstaller/Ruby1
.9.3'
[WARN] Updating (with backup) DevKit helper library for 'C:/RailsInstaller/Ruby1
.9.3'
I have installed ruby using rails installer.
This is the content in my config.yml file,
# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
#
# Example:
#
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
#
---
- C:\RailsInstaller\Ruby1.9.3
Is just a warning, ignore it, don't --force it, use Ruby and live long and prosper.