Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `exists?' for Ruby 3.x #2389

Closed
dkkb opened this issue Feb 28, 2023 · 9 comments · Fixed by #2411
Closed

undefined method `exists?' for Ruby 3.x #2389

dkkb opened this issue Feb 28, 2023 · 9 comments · Fixed by #2411

Comments

@dkkb
Copy link

dkkb commented Feb 28, 2023

Describe the bug

Couldn't install Pods. Updating the Pods project and trying again...
Couldn't install Pods. Updating the Pods project and trying again...
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file:
[!] Invalid `RNGestureHandler.podspec` file: undefined method `exists?' for File:Class.

 #  from /Users/da/github/ping2/node_modules/react-native-gesture-handler/RNGestureHandler.podspec:5
 #  -------------------------------------------
 #
 >  isUserApp = File.exists?(File.join(__dir__, "..", "..", "node_modules", "react-native", "package.json"))
➜ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin22]

Related issue: expo/expo#20757

You can also find the same issue from https://stackoverflow.com/questions/75441024/eas-build-gives-invalid-rngesturehandler-podspec-file-undefined-method-exis.

Ignite version

8.5.1

Additional info

➜ npx ignite-cli doctor 23-02-28 9:25:16
System
platform darwin
arch arm64
cpu 10 cores Apple M1 Pro
directory ping2 /Users/da/github/ping2

JavaScript (and globally-installed packages)
node 16.19.0 /opt/homebrew/opt/node@16/bin/node
npm 8.19.3 /opt/homebrew/opt/node@16/bin/npm
yarn 1.22.19
yrm 1.0.6
yarn 1.22.19 /opt/homebrew/bin/yarn
pnpm - not installed
expo 47.0.13 managed

Ignite
ignite-cli 8.5.1 /Users/da/.npm/_npx/e31027f3785124a8/node_modules/.bin/ignite
ignite src build /Users/da/.npm/_npx/e31027f3785124a8/node_modules/ignite-cli/build

Android
java - not installed
android home - undefined

iOS
xcode 14.1
cocoapods 1.11.3 /opt/homebrew/bin/pod

Tools
git git version 2.38.1 /opt/homebrew/bin/git

@dkkb dkkb added the bug label Feb 28, 2023
@localhost-9527
Copy link

Same issue with ruby 2.7.6p219 and cocoapods 1.11.3. FIxed it after changing cocoapods to 1.11.2.

@tunv8zzz
Copy link

tunv8zzz commented Mar 3, 2023

or you add bin/postInstall
line 11

run("sed -i .orig 's/File\.exists\?/File\.exist\?/g' node_modules/react-native-gesture-handler/RNGestureHandler.podspec")
run("sed -i .orig 's/File\.exists\?/File\.exist\?/g' node_modules/react-native-reanimated/scripts/reanimated_utils.rb")

@shariq93
Copy link

shariq93 commented Mar 5, 2023

Facing same issues and above solutions not working for me

@Dentling
Copy link

Dentling commented Mar 7, 2023

Had the same issues.
I fixed it by updating react-native-gesture-handler from 2.8.0 to 2.9.0.
Afterwards the same issue appeared for react-native-reanimated.
Updating this one from 2.12.0 to 2.14.4 fixed all issues.

@tunv8zzz
Copy link

tunv8zzz commented Mar 8, 2023

but, u using react-native-vision-camera error project

@ryskin
Copy link

ryskin commented Mar 8, 2023

I fixed it by starting use rbenv and more latest ruby version

@ryskin
Copy link

ryskin commented Mar 8, 2023

maybe when you make pod install it's using old version of ruby

@infinitered-circleci
Copy link

🎉 This issue has been resolved in version 8.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@hasansajora
Copy link

[!] Invalid RNGestureHandler.podspec file: undefined method `exists?' for File:Class.

Facing the issue with the latest version 8.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants