'id' not being correctly set when creating new record

(spun off from my problem with acts_as_attachment)

I'm seeing a problem where the id is not being set when a record is saved. I set up a new, simple Rails app, with one database table. I try this in the console:

~/RoR/testaaa john$ script/console Loading development environment.


=> #<Book:0x255cab4 @attributes={"name"=>nil}, @new_record=true>


=> "asdf"


=> true


=> #<Book:0x255cab4 @errors=#<ActiveRecord::Errors:0x24344ac @errors={}, @base=#<Book:0x255cab4 ...>>, @attributes={"name"=>"asdf", "id"=>0}, @new_record=false>

Now, I'm pretty sure that after saving the id should be set to the id of the record. Looking at the db (sqlite in this case), the id is being properly autoincremented and set:

~/RoR/testaaa john$ sqlite3 db/testaaa_development SQLite version 3.1.3 Enter ".help" for instructions

select * from books;


Has anyone seen this? I've got up to date gems.


For anyone else who happens to run into this. Apparently, something changed somewhere to cause sqlite3 and ruby to not work (some details here: SQLite 3 and Ruby finally working on OS X :: scottstuff.net )

I ended up installing SWIG from source (I don't have Darwinports installed), and removed and reinstalled the sqlite3 gem and it's all working again.