Skip to content

Instantly share code, notes, and snippets.

@collin
Created May 11, 2010 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save collin/397839 to your computer and use it in GitHub Desktop.
Save collin/397839 to your computer and use it in GitHub Desktop.
require "dm-core"
require "dm-migrations"
DataMapper.setup(:default, "sqlite3://:memory:")
class Foo
include DataMapper::Resource
property :id, Serial
property :bar, Object
end
Foo.auto_migrate!
foo = Foo.new
foo.bar = "HELLO"
foo.save
foo.reload
foo.bar # BOOM
Foo.first # BOOM
require "dm-core"
require "dm-migrations"
DataMapper.setup(:default, "sqlite3://:memory:")
class Foo
include DataMapper::Resource
property :id, Serial
property :baz, Object, :default => lambda{|*| Hash.new }, :lazy => false
end
Foo.auto_migrate!
foo = Foo.create
foo.reload
foo.baz # BOOM
source :gemcutter
git "git://github.com/rails/rails.git"
gem "rake"
gem "jeweler"
gem "shoulda"
gem "activesupport", "~> 3.0.0.beta1", :require => "active_support"
gem "data_objects", "~> 0.10.1"
gem "do_sqlite3"
gem "dm-do-adapter", :git => "git://github.com/datamapper/dm-do-adapter.git"
gem "dm-sqlite-adapter", :git => "git://github.com/datamapper/dm-sqlite-adapter.git"
gem "dm-aggregates", :git => "git://github.com/datamapper/dm-aggregates.git"
gem 'dm-migrations', :git => 'git://github.com/datamapper/dm-migrations.git'
gem 'dm-timestamps', :git => 'git://github.com/datamapper/dm-timestamps.git'
gem 'dm-transactions', :git => 'git://github.com/datamapper/dm-transactions.git'
gem 'dm-types', :git => 'git://github.com/datamapper/dm-types.git'
gem 'dm-validations', :git => 'git://github.com/datamapper/dm-validations.git'
gem 'dm-aggregates', :git => 'git://github.com/datamapper/dm-aggregates.git'
gem 'dm-constraints', :git => 'git://github.com/datamapper/dm-constraints.git'
gem 'dm-observer', :git => 'git://github.com/datamapper/dm-observer.git'
gem "dm-core", :git => "git://github.com/datamapper/dm-core.git", :branch => "next"
@collin
Copy link
Author

collin commented May 11, 2010

Error on boom.rb

TypeError: incompatible marshal file format (can't be read)
format version 4.8 required; 72.69 given
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/property/object.rb:25:in load' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/property/object.rb:25:inload'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/model.rb:568:in block (2 levels) in load' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/model.rb:561:ineach'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/model.rb:561:in block in load' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/model.rb:540:inmap'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/model.rb:540:in load' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/repository.rb:162:inread'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/model.rb:375:in first' from (irb):49 from /Users/iMac4/.rvm/rubies/ruby-1.9.1-p378/bin/irb:17:in

'

@collin
Copy link
Author

collin commented May 11, 2010

error on boom2.rb

ArgumentError: marshal data too short
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-do-adapter-1d52cea8904d4da687c2fddabd5bf999c94cd21e-master/lib/dm-do-adapter/adapter.rb:145:in next!' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-do-adapter-1d52cea8904d4da687c2fddabd5bf999c94cd21e-master/lib/dm-do-adapter/adapter.rb:145:inblock in read'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-do-adapter-1d52cea8904d4da687c2fddabd5bf999c94cd21e-master/lib/dm-do-adapter/adapter.rb:260:in with_connection' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-do-adapter-1d52cea8904d4da687c2fddabd5bf999c94cd21e-master/lib/dm-do-adapter/adapter.rb:138:inread'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/repository.rb:162:in read' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/collection.rb:1118:inlazy_load'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/support/lazy_array.rb:411:in each' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/collection.rb:510:ineach'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/collection.rb:1324:in map' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/collection.rb:1324:inresources_added'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/collection.rb:707:in replace' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/collection.rb:84:inreload'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/resource.rb:889:in eager_load' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/resource.rb:872:inlazy_load'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/property.rb:680:in lazy_load' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/resource/state/persisted.rb:23:inlazy_load'
from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/resource/state/persisted.rb:8:in get' from /Users/iMac4/.rvm/gems/ruby-1.9.1-p378/bundler/gems/dm-core-37b4bd22b9e3842977cf83d32baba459607e900a-next/lib/dm-core/model/property.rb:233:inbaz'
from (irb):54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment