Failed to read file or folder at /Users/distiller/project/Cartfile

Hi, I’m using CircleCI for our open source projects. We want to try version 2.0. In our iOS frameworks, we use Carthage to manage dependencies, and there’s problem locating the Cartfile, although both Cartfile.resolved and Cartfile are checked into git.

Here is the log

#!/bin/bash --login -o pipefail
carthage bootstrap
^D^D*** No Cartfile.resolved found, updating dependencies
Failed to read file or folder at /Users/distiller/project/Cartfile: Error Domain=NSCocoaErrorDomain Code=260 “The file “Cartfile” couldn’t be opened because there is no such file.” UserInfo={NSFilePath=/Users/distiller/project/Cartfile, NSUnderlyingError=0x7fd99842d950 {Error Domain=NSPOSIXErrorDomain Code=2 “No such file or directory”}}
Exited with code 1

And here is our config.yml

version: 2
jobs:
carthage:
macos:
xcode: “9.3.0”
shell: /bin/bash --login -o pipefail
steps:
- run: brew upgrade Carthage
- run: carthage bootstrap

I think maybe because config.yml is one level inside .circleci so it makes Carthage hard to locate the Cartfile which sits at the root of the project?

Hi there,

You should add a checkout command to your config.yml to checkout your repo before running commands:

version: 2
  jobs:
    carthage:
      macos:
        xcode: “9.3.0”
      shell: /bin/bash --login -o pipefail
      steps:
        - checkout
        - run: brew upgrade Carthage
        - run: carthage bootstrap

Hi Marc, thanks for the instant reply. You’re right, need to run checkout first.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.