Skip to content

podhelper.rb uses deprecated, recently-removed exists? method #109385

Description

@jack7758258

Automatically signing iOS for device deployment using specified development team
in Xcode project: 89B89GC38P
Running pod install... 324ms
CocoaPods' output:
↳

[!] Invalid `Podfile` file: undefined method `exists?' for File:Class

  return [] unless File.exists? file_path
                       ^^^^^^^^
Did you mean?  exist?.

 #  from /Users/project/new1/ios/Podfile:38
 #  -------------------------------------------
 #    use_modular_headers!
 >    flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
 #  end
 #  -------------------------------------------

Activity

  1. added
    platform-iosiOS applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    a: buildBuilding flutter applications with the tool
    on Aug 11, 2022
  2. stuartmorgan-g commented on Aug 11, 2022

    @stuartmorgan-g
    Contributor

    Looks like exists? was removed in ruby/ruby@bf97415 so the script won't work with very recent versions of Ruby.

    /cc @jmagman

  3. christopherfujino commented on Aug 11, 2022

    @christopherfujino
    Contributor

    oh dear

  4. changed the title [-]M1 flutter build [/-] [+]`podhelper.rb` uses deprecated, recently-removed `exists?` method[/+] on Aug 11, 2022
  5. jmagman commented on Aug 12, 2022

    @jmagman
    Member

    Looks like it was removed in Ruby 3.2, which is still in preview. Ruby 3.1.2 was the last released version.

  6. jmagman commented on Aug 12, 2022

    @jmagman
    Member

    @jack7758258

    1. What's the output of $ ruby -v
    2. If you open path/to/flutter-sdk/packages/flutter_tools/bin/podhelper.rb and change this line:
    - return [] unless File.exists? file_path
    + return [] unless File.exists file_path

    does the flutter command succeed on your iOS project?

  7. jack7758258 commented on Aug 12, 2022

    @jack7758258
    Author

    Error resolved by switching to Ruby3.1.2

  8. jmagman commented on Aug 12, 2022

    @jmagman
    Member

    Error resolved by switching to Ruby3.1.2

    Can you switch back and validate that the diff works on 3.2?

  9. jmagman commented on Aug 12, 2022

    @jmagman
    Member

    @jack7758258 alternatively, the fix #109428 has merged into master. Can you switch back to Ruby 3.2 preview, check out the Flutter master channel and validate that you are able to build your iOS app? Your validation of the fix would be really helpful!

  10. github-actions commented on Aug 26, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: buildBuilding flutter applications with the toolpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions