Feedzirra and How I Installed It

I’m an Ubuntu user and wanted to give the Feedzirra gem a shot and play with some RSS feeds today but unfortunately I ran into a few problems — which were CAKE to fix thanks to apt-get and hopefully this post will save you some time!

So, according to paul dix, to get this baby installed you need to run:

io@crazo:~$ sudo gem install pauldix-feedzirra

If that works, please carry on with life and have some funs with RSS. If you get the following error the fix MIGHT be as simple as installing libcurl3-dev:

io@crazo:~$ sudo gem install pauldix-feedzirra
Building native extensions.  This could take a while...
ERROR:  Error installing pauldix-feedzirra:
	ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install pauldix-feedzirra
checking for curl-config... no
checking for main() in -lcurl... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/ruby1.8
	--with-curl-dir
	--without-curl-dir
	--with-curl-include
	--without-curl-include=${curl-dir}/include
	--with-curl-lib
	--without-curl-lib=${curl-dir}/lib
	--with-curllib
	--without-curllib
extconf.rb:9:   Can't find libcurl or curl/curl.h (RuntimeError)

  Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
  options to extconf.

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/taf2-curb-0.2.7 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/taf2-curb-0.2.7/ext/gem_make.out

After reading that butt load of output i noticed this line:

extconf.rb:9:   Can't find libcurl or curl/curl.h (RuntimeError)

Two flags here: 1. the bitching about curl makes me think i don’t have curl installed and 2. curl.h = header and normally the header stuff is in the dev package so I should try that out.

io@crazo:~$ sudo apt-get install libcurl3-dev

Lots of other stuff was installed with this:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting libcurl4-openssl-dev instead of libcurl3-dev
The following packages were automatically installed and are no longer required:
  mplayer-skins mplayer libglide2 libggi2 libgii1 libgii1-target-x
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  comerr-dev libcurl4-openssl-dev libidn11-dev libkadm55 libkrb5-dev libldap2-dev libssl-dev
Suggested packages:
  libcurl3-dbg krb5-doc
The following NEW packages will be installed:
  comerr-dev libcurl4-openssl-dev libidn11-dev libkadm55 libkrb5-dev libldap2-dev libssl-dev
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 4568kB of archives.
After this operation, 12.8MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com intrepid-updates/main libssl-dev 0.9.8g-10.1ubuntu2.1 [1981kB]
Get:2 http://us.archive.ubuntu.com intrepid/main libidn11-dev 1.8+20080606-1 [574kB]
Get:3 http://us.archive.ubuntu.com intrepid/main libkadm55 1.6.dfsg.4~beta1-3 [151kB]
Get:4 http://us.archive.ubuntu.com intrepid/main comerr-dev 2.1-1.41.3-1ubuntu1 [41.6kB]
Get:5 http://us.archive.ubuntu.com intrepid/main libkrb5-dev 1.6.dfsg.4~beta1-3 [92.1kB]
Get:6 http://us.archive.ubuntu.com intrepid-updates/main libldap2-dev 2.4.11-0ubuntu6.1 [824kB]
Get:7 http://us.archive.ubuntu.com intrepid/main libcurl4-openssl-dev 7.18.2-1ubuntu4 [904kB]
Fetched 4568kB in 24s (184kB/s)
Selecting previously deselected package libssl-dev.
(Reading database ... 192128 files and directories currently installed.)
Unpacking libssl-dev (from .../libssl-dev_0.9.8g-10.1ubuntu2.1_i386.deb) ...
Selecting previously deselected package libidn11-dev.
Unpacking libidn11-dev (from .../libidn11-dev_1.8+20080606-1_i386.deb) ...
Selecting previously deselected package libkadm55.
Unpacking libkadm55 (from .../libkadm55_1.6.dfsg.4~beta1-3_i386.deb) ...
Selecting previously deselected package comerr-dev.
Unpacking comerr-dev (from .../comerr-dev_2.1-1.41.3-1ubuntu1_i386.deb) ...
Selecting previously deselected package libkrb5-dev.
Unpacking libkrb5-dev (from .../libkrb5-dev_1.6.dfsg.4~beta1-3_i386.deb) ...
Selecting previously deselected package libldap2-dev.
Unpacking libldap2-dev (from .../libldap2-dev_2.4.11-0ubuntu6.1_i386.deb) ...
Selecting previously deselected package libcurl4-openssl-dev.
Unpacking libcurl4-openssl-dev (from .../libcurl4-openssl-dev_7.18.2-1ubuntu4_i386.deb) ...
Processing triggers for man-db ...
Processing triggers for doc-base ...
Processing 2 added doc-base file(s)...
Registering documents with scrollkeeper...
Setting up libssl-dev (0.9.8g-10.1ubuntu2.1) ...
Setting up libidn11-dev (1.8+20080606-1) ...

Setting up libkadm55 (1.6.dfsg.4~beta1-3) ...

Setting up comerr-dev (2.1-1.41.3-1ubuntu1) ...

Setting up libkrb5-dev (1.6.dfsg.4~beta1-3) ...
Setting up libldap2-dev (2.4.11-0ubuntu6.1) ...
Setting up libcurl4-openssl-dev (7.18.2-1ubuntu4) ...

Processing triggers for libc6 ...
ldconfig deferred processing now taking place
io@crazo:~$

Now let’s try feedzirra again:

io@crazo:~$ sudo gem install pauldix-feedzirra
Building native extensions.  This could take a while...
Successfully installed taf2-curb-0.2.7
Successfully installed pauldix-feedzirra-0.0.1
2 gems installed
Installing ri documentation for taf2-curb-0.2.7...
Installing ri documentation for pauldix-feedzirra-0.0.1...
Installing RDoc documentation for taf2-curb-0.2.7...
Installing RDoc documentation for pauldix-feedzirra-0.0.1...

Bam! It’s in and installed the correct fork of curb (taf2-curb).

Side note:  In order to install gems from GitHub you need to add GitHub as a gem source.