question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crystal compiler not found. Some features can throw errors.

See original GitHub issue

Description

I tested all possible paths (e.g. default, which, brew, #33). But still shows that the compiler path was not found. I tested some crystal versions (e.g. 0.27.0, 0.27.1, 0.27.2). Crystal compiler not found related issues: #19 #33 #62 #63.

Already Tested

  • Default
Just the default.
{
	"crystal-lang.compiler": "crystal"
}
  • Which
iMac:~ User$ which crystal
/usr/local/bin/crystal
{
	"crystal-lang.compiler": "/usr/local/bin/crystal"
}
  • HomeBrew
/usr/local/Cellar/crystal/0.27.2 (957 files, 50.3MB) *
  Poured from bottle on 2019-02-08 at 01:13:58
{
	"crystal-lang.compiler": "/usr/local/Cellar/crystal/0.27.2/bin/crystal"
}
  • Issue
faustinoaq #33
{
	"crystal-lang.compiler": "/usr/local/Cellar/crystal/0.27.2/src/compiler/crystal"
}

Version Info

Vs Code:
  Version 1.30.2 (1.30.2)
  61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
  2019-01-07T22:42:11.005Z

Crystal:
  Crystal 0.27.2 (2019-02-05)
  LLVM: 6.0.1
  Default target: x86_64-apple-macosx

macOS:
  macOS 10.12.6 (16G29)

Marketplace:
  This Plugin: 0.3.14

Crystal Environment

iMac:compiler User$ crystal env
CRYSTAL_CACHE_DIR="/Users/User/.cache/crystal"
CRYSTAL_PATH="/usr/local/Cellar/crystal/0.27.2/src:lib"
CRYSTAL_VERSION="0.27.2"

HomeBrew Info

crystal: stable 0.27.2 (bottled), HEAD
Fast and statically typed, compiled language with Ruby-like syntax
https://crystal-lang.org/
/usr/local/Cellar/crystal/0.27.2 (957 files, 50.3MB) *
  Poured from bottle on 2019-02-08 at 01:13:58
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/crystal.rb
==> Dependencies
Build: libatomic_ops ✔
Required: bdw-gc ✔, gmp ✔, libevent ✔, libyaml ✔, llvm@6 ✔, pcre ✔, pkg-config ✔
==> Options
--HEAD
	Install HEAD version
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

Console Log

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:303 [Extension Host] Error: Command failed: crystal env
	at checkExecSyncError (child_process.js:613:13)
	at Object.execSync (child_process.js:653:13)
	at Object.execSync (ELECTRON_ASAR.js:721:23)
	at STDLIB (/Users/User/.vscode/extensions/faustinoaq.crystal-lang-0.3.14/out/src/crystalUtils.js:32:38)
	at Object.<anonymous> (/Users/User/.vscode/extensions/faustinoaq.crystal-lang-0.3.14/out/src/crystalUtils.js:44:3)
	at Object.<anonymous> (/Users/User/.vscode/extensions/faustinoaq.crystal-lang-0.3.14/out/src/crystalUtils.js:333:3)
	at Module.t._initNodeRequire.r._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:15:963)
	at Object.Module._extensions..js (module.js:653:10)
	at Module.load (module.js:561:32)
	at tryModuleLoad (module.js:504:12)
	at Function.Module._load (module.js:496:3)
	at Function.t._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:767:268)
	at Function.t.getExtensionPathIndex.then.s._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:749:538)
	at Function.t.getExtensionPathIndex.then.r._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:692:883)
	at Module.require (module.js:586:17)
	at n (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:15:738)
	at Object.<anonymous> (/Users/User/.vscode/extensions/faustinoaq.crystal-lang-0.3.14/out/src/crystalMain.js:14:24)
	at Object.<anonymous> (/Users/User/.vscode/extensions/faustinoaq.crystal-lang-0.3.14/out/src/crystalMain.js:78:3)
	at Module.t._initNodeRequire.r._compile (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:15:963)
	at Object.Module._extensions..js (module.js:653:10)
	at Module.load (module.js:561:32)
	at tryModuleLoad (module.js:504:12)
	at Function.Module._load (module.js:496:3)
	at Function.t._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:767:268)
	at Function.t.getExtensionPathIndex.then.s._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:749:538)
	at Function.t.getExtensionPathIndex.then.r._load (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:692:883)
	at Module.require (module.js:586:17)
	at require (internal/module.js:11:18)
	at Function.i [as __$__nodeRequire] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:31:146)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:757:987
	at t._doActivateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:758:80)
	at t._activateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:756:785)
	at Object.actualActivateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:754:119)
	at e._activateExtension (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:344:190)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:343:782
	at Array.map (<anonymous>)
	at e._activateExtensions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:343:757)
	at e.activateByEvent (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:342:14)
	at t._activateByEvent (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:755:255)
	at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:763:584
	at <anonymous>

Screenshot

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
faustinoaqcommented, Feb 9, 2019

Looking deep into this issue I just found more pitfalls in this extension codebase

Yep, STDLIB directory is not being detected at all, so, most Node.js based features don’t gonna work.

Seems many things have changed on latest vscode API 😅

Perfect solution, thank you! 

Yeah, looks like scry is the way to go 💯

1reaction
ghostcommented, Feb 9, 2019

BTW, Looking deep into this issue I just found more pitfalls in this extension codebase 😅 I guess Scry can solve it as well 😉

  • 👍

Advanced one. Try Scry, it supports errors ontype and other cool experimental stuff:

  • Perfect solution, thank you! 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crystal compiler not found. Some features can throw errors
I have installed crystal with homebrew and the compiler is in the path below: /usr/local/Cellar/crystal-lang/0.23.1_3/src/compiler/crystal But keep getting ...
Read more >
Null Pointer Exception
Null pointer exceptions, also known as NPEs, are pretty common errors.
Read more >
Compiler vs Interpreter – Difference Between Them
If incorrect, throws an error; If no error, the compiler will convert source code to machine code. It links different code files into...
Read more >
Maybe it's just because I come from Ruby, but Crystal ...
I found Crystal about a year ago and absolutely fell in love with it. ... V does not release any stable build and...
Read more >
Unable to compile Rust hello world on Windows: linker link. ...
Compiling helloworld v0.1.0 (C:\Users\DELL\helloworld) error: linker `link.exe` not found note: The system cannot find the file specified.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found