Skip to content

Instantly share code, notes, and snippets.

@JBlackCat
Last active June 19, 2016 18:53
Show Gist options
  • Select an option

  • Save JBlackCat/fda152435a4af2054d113a74b297953b to your computer and use it in GitHub Desktop.

Select an option

Save JBlackCat/fda152435a4af2054d113a74b297953b to your computer and use it in GitHub Desktop.

Additional Ruby Requirements

person x
needed to install ruby-dev to install chef on the pi, the interwebz doesn’t seem to specify why it is needed. Does it allow you to compile dependencies?

The error without it is, can't find header files for ruby at /usr/lib/ruby/include/ruby.h

person y 
yeah, so whenever you install the `-dev` package, it installs any files that are required to develop things against it… generally it’s C/C++/etc header files
so for ruby-dev, it allows you to install rubygems that contain C code. they need to `#include <ruby.h>`, and `ruby-dev` ensures that they’re installed
similar to how if you install `node-sass`, it requires the node header files… but those are installed as part of node
since `node-sass` is linking to C++ stuff

person x
i c, seems like there is alot of extras needed for dealing with C/C++. that what all my errors seem to revolve around.

person y
yeah, generally, once you get the necessary packages installed, it all goes away
there’s a virtual package in apt called `build-essential` that installs shit like `gcc`, `make`, `autoconf`, etc.
so you generally want to install that on any machine that you’ll ever need to compile anything on.
and any `-dev` packages for the platforms that you’re building against.

there’s also cases where you have to install `-dev` packages for other software… so like, if you install a rubygem for connecting to redis, and the gem uses a C++ lib to talk to redis (for performance reasons), you’ll want to install both `redis-dev` and `ruby-dev` since the gem will do `#include <redis.h>` and `#include <ruby.h>`
 
what I do a lot, when I install stuff is like, let’s say I install redis, I’ll do `aptitude search redis` to figure out what the redis server package is… then I’ll do `aptitude search redis | grep dev` and see what in there makes sense to install

`aptitude` is a tool that allows you to search against available packages you may need to `apt-get install aptitude` and if you are curious about what a package does, you can do `apt-cache show <package-name>`

and it’ll tell you what version you have installed (if it’s installed) and normally (but not always) will have a brief description about what it is, and where to get more info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment