# Dsymutil is not being found but I can't specfy where it actually is

**URL:** <https://forum.crystal-lang.org/t/dsymutil-is-not-being-found-but-i-cant-specfy-where-it-actually-is/6051>\
**Category:** Help & Support\
**Created:** [October 2, 2023, 4:55pm UTC](https://forum.crystal-lang.org/t/dsymutil-is-not-being-found-but-i-cant-specfy-where-it-actually-is/6051 "2023-10-02T16:55:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jyurek](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/jyurek/32/2180_2.png) [@jyurek](https://forum.crystal-lang.org/u/jyurek)\
**Post date:** [October 2, 2023, 4:55pm UTC](https://forum.crystal-lang.org/t/dsymutil-is-not-being-found-but-i-cant-specfy-where-it-actually-is/6051/1 "2023-10-02T16:55:03Z")

</div>

I’m running on MacOS 13.5.2, but started old and has been upgraded through the years (don’t know if that’s relevant but it might be). I’ve just installed crystal first via `asdf` and then, after that didn’t work, via homebrew.

In both cases, I’ve been trying to run a simple `puts "Hello, world"` via `crystal hello.cr` (and, later, via `crystal eval 'puts "Hello, World"'`). However, I keep getting this error:

```auto
Unable to get file info: '/usr/local/bin/dsymutil': Permission denied (File::AccessDeniedError)
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'raise<File::Error+>:NoReturn'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'Crystal::System::File::info?<String, Bool>:(File::Info | Nil)'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'Process::file_executable?<Path>:Bool'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'Process::find_executable<String>:(String | Nil)'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'Crystal::Compiler#codegen<Crystal::Program, Crystal::ASTNode+, Array(Crystal::Compiler::Source), String>:(Tuple(Array(Crystal::Compiler::CompilationUnit), Array(String)) | Nil)'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'Crystal::Compiler#compile:combine_rpath<Array(Crystal::Compiler::Source), String, Bool>:Crystal::Compiler::Result'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'Crystal::Compiler#compile:combine_rpath<Array(Crystal::Compiler::Source), String, Bool>:Crystal::Compiler::Result'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'Crystal::Command#eval:NoReturn'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in '__crystal_main'
  from /opt/homebrew/Cellar/crystal/1.9.2/bin/crystal in 'main'
Error: you've found a bug in the Crystal compiler. Please open an issue, including source code that will allow us to reproduce the bug: https://github.com/crystal-lang/crystal/issues

```

Now, I know that `dsymutil` does not live in `/usr/local/bin`. It lives in `/usr/bin`. I see `/usr/local/bin` in my PATH but nowhere else in my environment variables. I don’t see it anywhere in homebrew’s Formula. I don’t know where this is being specified. The question is twofold:

1. Why is crystal assuming it lives in /usr/local/bin instead of trying to locate?
2. How can I change this assumption?

---

<div class="post-metadata">

**Author:** ![bcardiff](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/bcardiff/32/3_2.png) [@bcardiff](https://forum.crystal-lang.org/u/bcardiff)\
**Post date:** [October 2, 2023, 6:01pm UTC](https://forum.crystal-lang.org/t/dsymutil-is-not-being-found-but-i-cant-specfy-where-it-actually-is/6051/2 "2023-10-02T18:01:46Z")

</div>

I think is failing because it tries to check if `/usr/local/bin/dsymutil` exists at all and failing in that check.

If you drop or tweak the order in `PATH` you should get pass this I think.

That being said, maybe `Process.file_executable?` should not raise in this case. Is there anything to say regarding the permissions on that folder?

---

<div class="post-metadata">

**Author:** ![Devonte](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/devonte/32/1927_2.png) [@Devonte](https://forum.crystal-lang.org/u/Devonte)\
**Post date:** [October 2, 2023, 7:30pm UTC](https://forum.crystal-lang.org/t/dsymutil-is-not-being-found-but-i-cant-specfy-where-it-actually-is/6051/3 "2023-10-02T19:30:07Z")

</div>

The actual exception comes from `Crystal::System::File.info?` which by its very definition shouldn’t raise an exception. Looking at its implementation confirms this, and `Crystal::System::File.info` just wraps it and re-raises an exception.

Being unable to stat `/usr/local/bin` also doesn’t sound unusual to me as that’s generally a protected directory, but that makes me wonder how this issue hasn’t crept up before on MacOS when running anything with debug. 🤔

---

<div class="post-metadata">

**Author:** ![jyurek](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/jyurek/32/2180_2.png) [@jyurek](https://forum.crystal-lang.org/u/jyurek)\
**Post date:** [October 3, 2023, 11:52am UTC](https://forum.crystal-lang.org/t/dsymutil-is-not-being-found-but-i-cant-specfy-where-it-actually-is/6051/4 "2023-10-03T11:52:25Z")

</div>

Ok, so running `PATH=/usr/bin:$PATH crystal eval 'puts "Hello, World"'` works, which is good to know.

But it does feel odd to have /usr/bin higher in the PATH than /usr/local/bin. Though, I guess, since I know basically nothing is using /usr/local/bin, it should be fine to muck around with the default PATH building in my shell. Ah, well. Thank you both for the answer!
