bitrise-steplib / steps-cocoapods-install

MIT License
23 stars 18 forks source link

Apple M1 with last ruby version - Step fails #88

Closed antoinepemeja closed 11 months ago

antoinepemeja commented 1 year ago

Troubleshooting

Issue description

My issue is only reproductible locally in my Apple M1. When I run the step

- cocoapods-install@2:
   inputs:
   - podfile_path: ios/Podfile

I have this error : Failed to check if cocoapods 1.11.3 installed, error: unknown ruby installation type

The entire log :

██████╗ ██╗████████╗██████╗ ██╗███████╗███████╗
██╔══██╗██║╚══██╔══╝██╔══██╗██║██╔════╝██╔════╝
██████╔╝██║   ██║   ██████╔╝██║███████╗█████╗
██╔══██╗██║   ██║   ██╔══██╗██║╚════██║██╔══╝
██████╔╝██║   ██║   ██║  ██║██║███████║███████╗
╚═════╝ ╚═╝   ╚═╝   ╚═╝  ╚═╝╚═╝╚══════╝╚══════╝
version: 2.0.0

CI mode: false
PR mode: false
Debug mode: false
Secret filtering mode: true
Secret Envs filtering mode: true
No output timeout mode: false

Running workflow: cocoa

Switching to workflow: cocoa
Step uses latest version, updating StepLib...
+------------------------------------------------------------------------------+
| (0) Run CocoaPods install                                                    |
+------------------------------------------------------------------------------+
| id: cocoapods-install                                                        |
| version: 2.3.0                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2022-11-23T15:40:30-05:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
ConfigsModel:
- command: install
- source_root_path: /Users/antoinepemeja/Documents/Git/[REDACTED]/react-native-silo
- podfile_path: ios/Podfile
- verbose: false
- is_cache_disabled: false

Using Podfile: /Users/antoinepemeja/Documents/Git/[REDACTED]/react-native-silo/ios/Podfile

Determining required cocoapods version
Searching for Podfile.lock
Found Podfile.lock: /Users/antoinepemeja/Documents/Git/[REDACTED]/react-native-silo/ios/Podfile.lock
Required CocoaPods version (from Podfile.lock): 1.11.3
Searching for gem lockfile with cocoapods gem
No gem lockfile with cocoapods gem found at: 
Using system installed CocoaPods version

Installing cocoapods
Checking cocoapods 1.11.3 gem
Failed to check if cocoapods 1.11.3 installed, error: unknown ruby installation type
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | Run CocoaPods install (exit code: 1)                          | 2.18 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-cocoapods-install/issues  |
| Source: https://github.com/bitrise-io/steps-cocoapods-install                |
+---+---------------------------------------------------------------+----------+

+------------------------------------------------------------------------------+
|                            bitrise summary: cocoa                            |
+---+---------------------------------------------------------------+----------+
|   | title                                                         | time (s) |
+---+---------------------------------------------------------------+----------+
| x | Run CocoaPods install (exit code: 1)                          | 2.18 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: https://github.com/bitrise-io/steps-cocoapods-install/issues  |
| Source: https://github.com/bitrise-io/steps-cocoapods-install                |
+---+---------------------------------------------------------------+----------+
| Total runtime: 2.18 sec                                                      |
+------------------------------------------------------------------------------+

Submitting anonymized usage information...
For more information visit:
https://github.com/bitrise-io/bitrise-plugins-analytics/blob/master/README.md

Bitrise build failed (exit code: 1)
  

Steps to reproduce

Because I use an Apple M1, I had to install correctly cocoapods without use the workaround with Rosetta. I mean, install the latest version of Ruby and then install cocoapods with gem -> https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1/66556339#66556339

antoines-MacBook-Pro react-native-silo % which ruby                
/opt/homebrew/opt/ruby/bin/ruby
antoines-MacBook-Pro react-native-silo % ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
antoines-MacBook-Pro react-native-silo % which pod
/opt/homebrew/lib/ruby/gems/3.1.0/bin/pod
antoines-MacBook-Pro react-native-silo % pod --version
1.11.3

FYI, if I try to keep with the ruby version installed by default in M1 and install cocoapods with BREW, the step fails too, but not for the same reason.

thank you

owens-ben commented 1 year ago

👍

shayan77 commented 1 year ago

I have the same issue and just wanted to know if you have any updates here.

JAIRMG commented 1 year ago

Hi, any updates? I am facing the same issue

owens-ben commented 1 year ago

I had luck manually setting my ruby version to 2.7.6

JAIRMG commented 1 year ago

@owens-ben I am using a newer version of ruby and ruby version prior 3.0 will no longer be supported

martyphee commented 1 year ago

Having an issue also with this. Even though it says pod is installed it isn't

ConfigsModel:
- command: install
- source_root_path: /Users/vagrant/git
- podfile_path: <unset>
- verbose: false
- is_cache_disabled: false
Searching for Podfile
Found Podfile: /Users/vagrant/git/ios/Podfile
Determining required cocoapods version
Searching for Podfile.lock
Found Podfile.lock: /Users/vagrant/git/ios/Podfile.lock
Required CocoaPods version (from Podfile.lock): 1.12.1
Searching for gem lockfile with cocoapods gem
No gem lockfile with cocoapods gem found at: 
Using system installed CocoaPods version
Check selected Ruby is installed
Ruby 3.2.1 is installed
Installing cocoapods
Checking cocoapods 1.12.1 gem
Installed
cocoapods version:
$ pod "_1.12.1_" "--version"
rbenv: pod: command not found
The `pod' command exists in these Ruby versions:
  2.7.6
command failed, error: exit status 127
command failed, error: exit status 127
martyphee commented 1 year ago

Looks like our issue came down to having snyk in there which does an install. Somehow it was causing this step to see pod installed in 2.x ruby vs 3.x ruby.

bitrise-coresteps-bot commented 1 year ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

bitrise-coresteps-bot commented 11 months ago

I'll close this issue as it doesn't seem to be relevant anymore. We believe an old issue probably has a bunch of context that's no longer relevant, therefore, if the problem still persists, please open a new issue.