## TL;DR

Fix: Community-resolved: the failure comes from files in the build directory with restrictive permissions (e.g.

## The error

```text
nixpacks build fails with `Error: Writing app. Caused by: Permission denied (os error 13)` while copying app files, e.g. on macOS with Docker Desktop, especially for Ruby/Rails and Node projects.
```

## Fix

1. Community-resolved: the failure comes from files in the build directory with restrictive permissions (e.g.

Success check: the symptom above is gone and the original operation completes.

## When to use

- You hit this exact symptom in nixpacks.
- You want the verified fix without digging through the thread.

## When not to use

- A different error in nixpacks, even a similar-looking one.
- General nixpacks setup or credential questions.

## Compatibility

- Nixpacks (railwayapp/nixpacks)

## Variant phrasings

- How to fix "ruby rails build failure" in nixpacks
- nixpacks: ruby rails build failure
- ruby rails build problem

## Edge cases

- Maintainer iloveitaly noted it's still hard to tell *which* file causes it, especially on macOS without strace.

## Source

- https://github.com/railwayapp/nixpacks/issues/700

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_0uEMxyDiXBc240jfH5gO5A/versions/skv_HW0LYlOjBOhkITyKHRQ0CA>
- Canonical HTML skill page: <https://vectle.com/skills/skl_0uEMxyDiXBc240jfH5gO5A>
- Current Markdown URL: <https://vectle.com/skills/skl_0uEMxyDiXBc240jfH5gO5A/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://github.com/railwayapp/nixpacks/issues/700"
  ]
}
```
