Я пытаюсь использовать remarkable_activerecord-4.0.0.alpha4
с rspec-2.7.1
и rails-3.0.7
. На данный момент я не использовал его ни в одном примере. Я только что добавил его в Gemfile и сделал bundle install
. Я использую Spork для загрузки приложения прямо из рук. Когда я запускаю spork, я получаю следующую ошибку:
undefined method `alias_example_to' for RSpec::Core::ExampleGroup:Class (NoMethodError)
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/remarkable-4.0.0.alpha4/lib/remarkable/core/rspec.rb:26:in `<class:ExampleGroup>'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/remarkable-4.0.0.alpha4/lib/remarkable/core/rspec.rb:13:in `<module:Core>'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/remarkable-4.0.0.alpha4/lib/remarkable/core/rspec.rb:12:in `<module:RSpec>'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/remarkable-4.0.0.alpha4/lib/remarkable/core/rspec.rb:1:in `<top (required)>'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/remarkable-4.0.0.alpha4/lib/remarkable/core.rb:11:in `<top (required)>'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/remarkable_activemodel-4.0.0.alpha4/lib/remarkable/active_model.rb:2:in `<top (required)>'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/remarkable_activerecord-4.0.0.alpha4/lib/remarkable/active_record.rb:2:in `<top (required)>'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/home/chandranshu/work/pep/data_entry/branches/ws_chan_r2_test_cases/spec/spec_helper.rb:4:in `<top (required)>'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `block in load'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/lib/spork/test_framework.rb:138:in `block (2 levels) in preload'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/lib/spork/app_framework/rails.rb:8:in `preload'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/lib/spork/test_framework.rb:134:in `block in preload'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/lib/spork.rb:62:in `exec_prefork'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/lib/spork/test_framework.rb:120:in `preload'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/lib/spork/run_strategy/forking.rb:25:in `preload'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/lib/spork/runner.rb:74:in `run'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/lib/spork/runner.rb:10:in `run'
/opt/ruby-1.9.2-p180/lib/ruby/gems/1.9.1/gems/spork-0.9.0.rc9/bin/spork:10:in `<top (required)>'
/opt/ruby-1.9.2-p180/bin/spork:19:in `load'
/opt/ruby-1.9.2-p180/bin/spork:19:in `<main>'
Я посмотрел в RSpec::Core::ExampleGroup
и там присутствует метод alias_example_to
. Как мне отладить это?
Обновление
После прочтения соответствующего поста я отредактировал рассматриваемый файл, чтобы явно загрузить rspec, и он начал работать нормально. Я сразу понял, что порядок операторов require 'rspec/rails'
и require 'remarkable/active_record'
в моем spec_helper был неправильным. Исправил это, и это сработало немедленно.