From: Brian Candler Date: 2010-01-27T22:43:16+09:00 Subject: Re: being confused about libraries Roger Braun wrote: > Hi, > > On Wed, Jan 27, 2010 at 1:20 PM, Ruby Newbee > wrote: >> So what's the relation between the system "sqlite3" and (most likely) >> ruby's "sqlite3-ruby"? > > Usually, the Ubuntu package is the library written in C (or some other > language) and the gem provides a ruby wrapper for these libraries. > That's why you need both. Not exactly. If you "apt-get install libsqlite3-ruby", then you get Ubuntu's package containing the ruby library which talks to the C library (libsqlite3-0). The C library is automatically installed as a dependency. This is not a gem; the code is installed under ruby's site library directory. If you install the gem ("gem install sqlite3-ruby") then rubygems fetches, builds and installs its own version of this ruby library. In order for this to work, not only does the C library have to be present, but also the C library's header files (libsqlite3-dev), the Ruby header files (ruby-dev) and the C compiler (build-essential) You only need one or other of these to access sqlite3 from ruby. The advantage of the gem approach is you can easily update it if a new version of the sqlite3-ruby gem is released. Ubuntu won't update their package unless there's a security issue, or until you move to the next version of Ubuntu. -- Posted via http://www.ruby-forum.com/.