views:

228

answers:

1

I've installed the newer version of SQLite3 (3.7.0.1) on my macbook (OS X 10.5) but 'sqlite3 --version' gives me the older version I had on my system:

$ sqlite3 --version
3.4.0

I suppose I was expecting this version to be overwritten but that doesn't seem to be the case. Can anyone clue me in? I'd really appreciate it, right now I'm trying to get started with Rails but I had received this error:

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

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for #include <sqlite3.h>
... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... no
checking for sqlite3_initialize()... no
sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!
*** 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.

Oddly enough though since installing the new version of sqlite3 this error has gone away (in other words sqlite3-ruby was installed successfully) - but sqlite3 still points to 3.4.0, I've checked the directories in my $PATH and they only contain 3.7.0.1

Thanks in advance for any help.

A: 

Have you tried telling the OS to use the new one by typing hash sqlite3? Sometimes an OS remembers the original version and doesn't know to refresh itself and hash will poke it in the eye.

Otherwise you might need to tell the gem to look in the right place. Check into these options in the installer:

    --with-sqlite3-dir 
    --with-sqlite3-include 
    --with-sqlite3-lib 
Greg
sqlite3 and sqlite3-ruby have both installed successfully, in sqlite3-ruby's case it found the correct sqlite3, so I'm done with installing - I'm just wondering why the old installation was not overwritten or removed? Furthermore I'm wondering where it is exactly? (I've checked all the places on my $PATH ... it has to be somewhere? is there any command a la: 'sqlite3 --show-me-where-the-hell-it-is?)
Dave
In general an installer should not overwrite a system installed package. There are usually good reasons they installed it where they did, such as system processes that expect it to be there, and at a certain version. The packages *will* overwrite if you force them to, but that can lead to a machine that doesn't work right. Installing into /usr/bin is risky. /usr/bin/local or other .../local/ paths is fairly safe, and, by tweaking your path you control whether the .../local/ version is found first. Hope that helps.
Greg