Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running Crystal on Ubuntu #4342

Closed
kazzkiq opened this Issue Apr 26, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@kazzkiq
Copy link

kazzkiq commented Apr 26, 2017

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

@mverzilli

This comment has been minimized.

Copy link
Member

mverzilli commented Apr 26, 2017

What happens if you run sudo apt-get install build-essential first?

@kazzkiq

This comment has been minimized.

Copy link
Author

kazzkiq commented Apr 26, 2017

It worked! 🎉

Perhaps this step could be added to the documentation in order to help users facing the same issue in the future?

Thanks!

@kazzkiq kazzkiq closed this Apr 26, 2017

@mverzilli

This comment has been minimized.

Copy link
Member

mverzilli commented Apr 26, 2017

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! :)

@matiasgarciaisaia

This comment has been minimized.

Copy link
Member

matiasgarciaisaia commented Apr 27, 2017

@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?

mverzilli added a commit to crystal-lang/crystal-book that referenced this issue May 7, 2017

@mlobl

This comment has been minimized.

Copy link

mlobl commented Mar 16, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.