install Sqlite3-ruby gem on ubuntu 11.10

When I tried to install the Ruby adapter for Sqlite3 on my Ubuntu dev box, I encountered this error:

Building native extensions. This could take a while…
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb install sqlite3-ruby
checking for fdatasync() in -lrt… yes
checking for sqlite3.h… no

make: *** No rule to make target `ruby.h’, needed by `sqlite3_api_wrap.o’. Stop.

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.4/ext/sqlite3_api/gem_make.out

After a look in some forums I found a solution. These are the steps needed to install the database and the adapter for Ruby 1.8.7

First I install the Sqlite3 database:
~$ sudo apt-get install sqlite3

After this we install the lib so we don’t get the error:
~$ sudo apt-get install libsqlite3-dev

Now we can install the gem without the error:
~$ sudo gem install sqlite3-ruby


2 thoughts on “install Sqlite3-ruby gem on ubuntu 11.10

  1. Wanted to drop a comment and let you know your Rss feed is not functioning today. I tried adding it to my Yahoo reader account and got nothing.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s