tree-sitter / tree-sitter-ruby

Ruby grammar for tree-sitter
MIT License
182 stars 58 forks source link

Error `fatal error: 'cstring' file not found` when compiling in MacBook M2 #248

Closed enrique-fernandez-polo closed 8 months ago

enrique-fernandez-polo commented 8 months ago

Hello there!

I am struggling to get this working in my laptop

nvim-treesitter[ruby]: Error during compilation
src/scanner.cc:4:10: fatal error: 'cstring' file not found
#include <cstring>
         ^~~~~~~~~
1 error generated.

I 've been playing around with gcc, llvm but I do not have that kind of knowledge 😅

Could you give me hand?? Thanks!

enrique-fernandez-polo commented 8 months ago

Well you know... You just have to create a issue to find the solution.

I had to set the CC env var to the proper path of the gcc command installed by brew.

CC=/opt/homebrew/bin/gcc-13 lvim . Did the trick.

amaanq commented 8 months ago

the grammar was just updated to have the scanner be written in C fyi to prevent issues like this in the future.