rom-rb/rom-rails

undefined method `finalize' for ROM::Rails::Railtie:Class (NoMethodError)

solnic opened this issue · 3 comments

From @kchien on June 16, 2015 16:57

Using the following gems:

# Gemfile
gem 'rails', '3.0.20'
gem 'rom', '0.7.1'
gem 'rom-rails', :git => 'https://github.com/kchien/rom-rails.git', :branch => 'wip_lower_version_in_gemspec'
gem 'rom-yaml', '0.1.0'

I got the following error when running my tests:

/Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/bundler/gems/rom-rails-4dc4edcb9332/lib/rom/rails/railtie.rb:46:in `block in <class:Railtie>': undefined method `finalize' for ROM::Rails::Railtie:Class (NoMethodError)
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/activesupport-3.0.20/lib/active_support/callbacks.rb:420:in `_run_prepare_callbacks'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/callbacks.rb:40:in `initialize'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:33:in `new'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:33:in `build'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:79:in `block in build'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:79:in `each'from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:79:in `inject'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/actionpack-3.0.20/lib/action_dispatch/middleware/stack.rb:79:in `build'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/application.rb:162:in `app'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/application/finisher.rb:35:in `block in <module:Finisher>'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:25:in `run'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:49:in `each'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/application.rb:134:in `initialize!'
from /Users/ken/.rbenv/versions/1.9.3-p484/gemsets/test_project/gems/railties-3.0.20/lib/rails/application.rb:77:in `method_missing'

Should #finalize be defined as a singleton method instead of as an instance method?

Technically speaking we don't support rails 3.0.x but if somebody can provide a patch for this I'm happy to merge

Rails doesn't even support 3.0.x anymore; I'm inclined to let this one close ...

yeah I agree, you can set up rom in rails without rom-rails anyway. Closing...