Understanding Ruby threads Rails performance scripts: profiler and benchmarker
Nov 18

As you may already know, Merb turned 1.0 a while ago and I decided to resume my studies to learn the framework.

So I just built a new app with a few resources and fired the migration scripts:

$ rake db:automigrate

And this is what I got:

Loading init file from /Users/leo/projects/merb/my-first-app/config/init.rb
Loading /Users/leo/projects/merb/my-first-app/config/environments/development.rb
 ~ Connecting to database...
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `initialize': wrong number of arguments (8 for 1) (ArgumentError)
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `new'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `normalize_uri'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/abstract_adapter.rb:44:in `initialize'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:159:in `initialize'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `new'
	from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `setup'
	from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:44:in `setup_connections'
	from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:27:in `connect'
	from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb_datamapper.rb:17:in `run'
	from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/bootloader.rb:99:in `run'
	from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:172:in `bootup'
	from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:42:in `start'
	from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core.rb:169:in `start'
	from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/bin/merb:11
	from /opt/local/bin/merb:19:in `load'
	from /opt/local/bin/merb:19

Lovely, isn’t it?
After a fair amount of googling around it turns out that there seems to be a problem with the URI parser Merb uses underneath, called Addressable.

As of the installation of Merb 1.0, the installed version of this library was 2.0.0.
The solution? Install a older Addressable version:

$ sudo gem uninstall addressable
 
You have requested to uninstall the gem:
	addressable-2.0.0
dm-core-0.9.6 depends on [addressable (>= 1.0.4)]
data_objects-0.9.6 depends on [addressable (>= 1.0.3)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  Y
Successfully uninstalled addressable-2.0.0
 
$ sudo gem install addressable -v 1.0.4
Successfully installed addressable-1.0.4
1 gem installed
Installing ri documentation for addressable-1.0.4...
Installing RDoc documentation for addressable-1.0.4...

I haven’t figured out the reason for this issue, so please do share if you know. I’ll be glad to update the post. :)

Related Posts

3 Responses to “Merb turns 1.0, and started driving me crazy”

  1. Colin says:

    Thank god for your post. I was just about ready to pull my hair out. As you may have guessed, my googling for the answer was not as successful as yours.

  2. Hey Colin, I’m really glad the post helped you.

    Tks for the comment.

  3. [...] googling for awhile I found this post that suggested downgrading the addressable gem back to 1.0.4.  I tried doing that but stuff was [...]

Leave a Reply

preload preload preload