Why can't I install the SQLite gem?

The SQLite RubyGem isn't actually a RubyGem, it's a "CGem", IOW it's written in C. This means it has to be compiled and linked to the Ruby interpreter when you install it and in order to do that it needs the C header files for the Ruby interpreter.

If you compile Ruby yourself, those header files will be installed automatically, however, in RedHat-ish systems, such header files are usually packaged in a seperate package, called <whatever>-dev. So, in this case you will need to install the ruby-dev package and possibly the libsqlite3-dev (Ubuntu) or sqlite-devel (Fedora) package as well.

However, you might be better off just installing your Operating System's pre-packaged libsqlite3-ruby package, that way all the dependencies are automatically satisfied.

(Note: all package names pulled out of thin air, might be different on your system.)


You probably need the ruby dev package. For Ubuntu you have to install ruby1.8-dev which includes the ruby header files. A quick google says that the yum package is ruby-devel. so run this:

sudo yum install ruby-devel


I faced problem installing sqlite3-ruby gem on my fedora 13 box. It was fixed after sudo yum install sqlite-devel