I just upgraded to snow leopard. Before, I had everything running fine, but now when I start the server from the terminal I get:
=> Booting WEBrick
=>
I had a similar issue. If you look at the stack backtrace, you can see that the file throwing the error is within sqlite-ruby itself:
def open( filename, utf16=false )
API.send( utf16 ? :sqlite3_open16 : :sqlite3_open, filename )
end
So the API class is missing. At top of this file is the following code which suggests that the API class comes from requiring the sqlite3_api file:
begin
require 'sqlite3_api'
rescue LoadError
if RUBY_PLATFORM =~ /mingw|mswin/ then
RUBY_VERSION =~ /(\d+.\d+)/
require "#{$1}/sqlite3_api"
end
end
As you can see, this code will ignore a LoadError on platforms other than mingw/mswin. This is bad, and something I would consider a bug in the sqlite3-ruby gem. To figure out what's wrong, try requiring sqlite3_api in irb:
$ irb
irb(main):001:0> require 'sqlite3_api'
LoadError: Unable to find library 'libsqlite3.so.8'. - /path/to/ruby/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.2.5/lib/sqlite3_api.sl
from (irb):1:in `require'
from (irb):1
from /path/to/ruby/bin/irb:12:in `<main>'
irb(main):002:0>
YMMV, but for me, I realised that I was missing something in my shared-library path. Once I corrected that, everything worked.
If you upgraded from Leopard, then you will need to reinstall the sqlite3-ruby gem. First install XCode, then run:
sudo gem install sqlite3-ruby
For some reason, this didn't work too well for me.
I had to basically start from scratch, following these instructions: http://hivelogic.com/articles/ruby-rails-leopard from the "Setting Up" stage.
To be clear, I tried the steps above. I tried installing XCode. I tried recompiling Rubygems...Only when I recompiled Ruby itself, THEN Rubygems, THEN uninstall and reinstall sqlite3-ruby did things clear up.
I hope this helps.