Friday, January 16, 2009

CentOS Development

I'm doing a lot of development on CentOS lately.

I've found that many things will fail because development packages are missing. For instance, this gem install fails:

sudo gem install curb
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install curb
checking for main() in -lcurl... no
*** extconf.rb failed ***

This can often be fixed by installing the devel version of whatever you need. In this case you can see that the -lcurl is missing. So you fix it like this:
sudo yum install curl-devel
Now the gem install will work:
sudo gem install curb
Building native extensions. This could take a while...
Successfully installed curb-0.1.4
1 gem installed
Installing ri documentation for curb-0.1.4...
Installing RDoc documentation for curb-0.1.4...
So keep an eye out for those foo-devel packages. You'll need a lot of them.