# Problem updating sqlite database with active record

**URL:** <https://www.ruby-forum.com/t/problem-updating-sqlite-database-with-active-record/157470>\
**Category:** Rails\
**Created:** [January 11, 2009, 11:34pm UTC](https://www.ruby-forum.com/t/problem-updating-sqlite-database-with-active-record/157470 "2009-01-11T23:34:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfaine](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b3f665/32.png) [@mfaine](https://www.ruby-forum.com/u/mfaine)\
**Post date:** [January 11, 2009, 11:34pm UTC](https://www.ruby-forum.com/t/problem-updating-sqlite-database-with-active-record/157470/1 "2009-01-11T23:34:34Z")

</div>

I am trying to use active record outside of rails using sqlite3-ruby (on  
OSX Tiger). This worked find with ruby 1.8.

After installing Ruby 1.9 using MacPorts (and installing rails and  
sqlite-ruby gem) I am getting an error (trace below) whenever I try to  
save changes (just retrieving works fine).

Any help would be appreciated.

* * *

require ‘active\_record’

ActiveRecord::Base.establish\_connection(  
:adapter =\> “sqlite3”,  
:dbfile =\> ‘/Users/mark/development/projects/hhparser/db/test.tmp.db’  
)

class GameType \< ActiveRecord::Base  
end

ActiveRecord::Base.logger = Logger.new(STDOUT)

gt = GameType.find(:first)  
gt.description = “tempdesc”  
gt.save

* * *

/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.2.2/lib/active\_support/dependencies.rb:442:in  
`rescue in load_missing_constant': uninitialized constant ActiveSupport::Multibyte (NameError) from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:438:in`load\_missing\_constant’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.2.2/lib/active\_support/dependencies.rb:77:in  
`const_missing_with_dependencies' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/quoting.rb:11:in`quote’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/base.rb:2825:in  
`quote_value' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/base.rb:2711:in`update’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/locking/optimistic.rb:70:in  
`update_with_lock' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/dirty.rb:146:in`update\_with\_dirty’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/callbacks.rb:253:in  
`update_with_callbacks' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/timestamp.rb:38:in`update\_with\_timestamps’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/base.rb:2699:in  
`create_or_update' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/callbacks.rb:222:in`create\_or\_update\_with\_callbacks’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/base.rb:2383:in  
`save' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/validations.rb:1009:in`save\_with\_validation’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/dirty.rb:79:in  
`save_with_dirty' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/transactions.rb:179:in`block in with\_transaction\_returning\_status’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/connection\_adapters/abstract/database\_statements.rb:66:in  
`transaction' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/transactions.rb:129:in`transaction’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/transactions.rb:138:in  
`transaction' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/transactions.rb:178:in`with\_transaction\_returning\_status’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/transactions.rb:146:in  
`block in save_with_transactions' from /opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active_record/transactions.rb:158:in`rollback\_active\_record\_state!’  
from  
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.2.2/lib/active\_record/transactions.rb:146:in  
`save_with_transactions' from ar_test.rb:18:in`block in ’  
from ar\_test.rb:15:in `each' from ar_test.rb:15:in`’
