I've installed Crystal in Ubuntu and when I try to run a file it gives me this error:
--: 1: --: cc: not found
Error: execution of command failed with code: 127: `cc -o "/root/.cache/crystal/opt-crystal-src-ecr-process.cr/macro_run" "${@}" -rdynamic -lpcre -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`
I installed following the docs installation guide.
Any code gives this error. I tried with a HTTP server and later with a simple puts. Both files lead to this error.
On my Macbook everything works perfectly.
Crystal version:
Crystal 0.22.0 [3c71228] (2017-04-20) LLVM 3.5.0
OS version:
Ubuntu 16.04.2 LTS x86_64 ($5 Digital Ocean Droplet)
512MB RAM
What happens if you run sudo apt-get install build-essential first?
It worked! 馃帀
Perhaps this step could be added to the documentation in order to help users facing the same issue in the future?
Thanks!
We need to tidy up a bit our release process... I guess it should be declared as a dependency of the Debian package. It's in the radar, don't worry! :)
@kazzkiq we have crystal-lang/omnibus-crystal#14 for making the packages state their dependencies.
Also, there's a list of every package you need _for compiling Crystal itself_ on the wiki - we should probably list the subset of them that's needed just for _running_ Crystal on the installation page.
Would you mind editing the language reference to add this info that's missing?
I had a similar issue installing on a relatively fresh Ubuntu 16.04 (OS X was just fine)
/usr/bin/ld: cannot find -lxml2
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/mlobl/.cache/crystal/crystal-run-spec.tmp' -rdynamic -lxml2 -lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`
The dependency I needed to install was libxml2-dev even though I had libxml2 already installed. Hopefully this helps others in the future
Most helpful comment
I had a similar issue installing on a relatively fresh Ubuntu 16.04 (OS X was just fine)
The dependency I needed to install was
libxml2-deveven though I hadlibxml2already installed. Hopefully this helps others in the future