Docunext


Interesting MongoDB Ruby Gems

February 26th, 2010

These rubygems look very cool:

I'm starting with sinatra_resource:

gem install sinatra_resource
Building native extensions.  This could take a while...
Successfully installed mongo-0.18.3
Successfully installed mongo_mapper-0.7.0
Successfully installed mongo_ext-0.18.3
Successfully installed query_string_filter-0.1.4
Successfully installed sinatra_resource-0.4.15
Successfully installed polyglot-0.3.0
6 gems installed

I'm trying out sinatra_resource, and while it looks really interesting, I'm having a tough time cracking the nut.

When I try to run the example datacatalog, I hit this error:

/var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:91:in `const_missing': wrong number of arguments (0 for 1) (ArgumentError)
	from /var/www/dev/sinatra_resource/lib/builder.rb:186:in `block in build_helpers'
	from /var/lib/gems/1.9.1/gems/sinatra-1.0.a/lib/sinatra/base.rb:893:in `class_eval'
	from /var/lib/gems/1.9.1/gems/sinatra-1.0.a/lib/sinatra/base.rb:893:in `helpers'
	from /var/www/dev/sinatra_resource/lib/builder.rb:185:in `build_helpers'
	from /var/www/dev/sinatra_resource/lib/builder.rb:31:in `build'
	from /var/www/dev/sinatra_resource/lib/resource.rb:59:in `build'
	from /var/www/dev/sinatra_resource/examples/datacatalog/resources/categories.rb:62:in `<module:DataCatalog>'
	from /var/www/dev/sinatra_resource/examples/datacatalog/resources/categories.rb:1:in `<top (required)>'
	from /var/lib/gems/1.9.1/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
	from /var/lib/gems/1.9.1/gems/polyglot-0.3.0/lib/polyglot.rb:65:in `require'
	from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
	from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
	from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
	from /var/www/dev/sinatra_resource/examples/datacatalog/app.rb:16:in `block in <top (required)>'
	from /var/www/dev/sinatra_resource/examples/datacatalog/app.rb:16:in `each'
	from /var/www/dev/sinatra_resource/examples/datacatalog/app.rb:16:in `<top (required)>'
	from config.ru:2:in `require'
	from config.ru:2:in `<main>'

Trying out dm-mongo-adapter

First things first: 'require mongo_adapter', not 'require dm-mongo-adapter'.

After that misstep, things went smoothly! It seems to have the awesome characteristics of most datamapper tools I've used.

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022