Я получил эту ошибку в rspec, хотя у меня нет никакой переменной или метода с таким именем, я даже искал по всему проекту.Это происходит, когда я запускаю Rspec для всех тестовых случаев, в то время как отдельные тестовые примеры работают нормально.
Я обновлял версию ruby on rails с ruby 2.3.3 rails 4.1.6.и я обновил версию одну за другой, и у меня все тесты пройдены после достижения rails 5.1.6 с ruby 2.4.5, я получил эту ошибку.хотя все тесты также работали нормально с той же версией ruby и rails 5.0.7
Пожалуйста, дайте мне знать, если у вас есть идеи, как решить эту проблему.
Я перестраиваю spec_helper.rb сноваиспользуя bin / rspec --init, я добавил зависимости и теперь у меня более длинная трассировка
NameError:
undefined local variable or method `app' for #<Devise::Mailer:0x00007fd3271928f8>
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/rack-test-1.1.0/lib/rack/test/methods.rb:30:in `build_rack_mock_session'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/rack-test-1.1.0/lib/rack/test/methods.rb:26:in `rack_mock_session'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/rack-test-1.1.0/lib/rack/test/methods.rb:41:in `build_rack_test_session'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/rack-test-1.1.0/lib/rack/test/methods.rb:37:in `rack_test_session'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/rack-test-1.1.0/lib/rack/test/methods.rb:45:in `current_session'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionview-5.1.6/lib/action_view/helpers/controller_helper.rb:18:in `assign_controller'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionview-5.1.6/lib/action_view/base.rb:211:in `initialize'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionpack-5.1.6/lib/action_dispatch/routing/url_for.rb:106:in `initialize'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionview-5.1.6/lib/action_view/rendering.rb:72:in `new'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionview-5.1.6/lib/action_view/rendering.rb:72:in `view_context'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionview-5.1.6/lib/action_view/rendering.rb:97:in `_render_template'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionview-5.1.6/lib/action_view/rendering.rb:83:in `render_to_body'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionpack-5.1.6/lib/abstract_controller/rendering.rb:24:in `render'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:945:in `block in collect_responses_from_templates'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:942:in `each'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:942:in `each'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:942:in `map'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:942:in `collect_responses_from_templates'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:927:in `collect_responses'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:830:in `mail'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/devise-4.5.0/lib/devise/mailers/helpers.rb:19:in `devise_mail'
# ./app/mailers/devise/mailer.rb:12:in `confirmation_instructions'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:186:in `process_action'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:97:in `run_callbacks'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:19:in `process_action'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:124:in `process'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/rescuable.rb:23:in `block in process'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/rescuable.rb:15:in `handle_exceptions'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/rescuable.rb:22:in `process'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionview-5.1.6/lib/action_view/rendering.rb:30:in `process'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:609:in `block in process'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in `block in instrument'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in `instrument'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/base.rb:608:in `process'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/message_delivery.rb:105:in `block in processed_mailer'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/message_delivery.rb:104:in `tap'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/message_delivery.rb:104:in `processed_mailer'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/actionmailer-5.1.6/lib/action_mailer/message_delivery.rb:95:in `deliver_now'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/devise-4.5.0/lib/devise/models/authenticatable.rb:200:in `send_devise_notification'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/devise-4.5.0/lib/devise/models/confirmable.rb:121:in `send_confirmation_instructions'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/devise-4.5.0/lib/devise/models/confirmable.rb:183:in `send_on_create_confirmation_instructions'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:413:in `block in make_lambda'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:260:in `block in conditional'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:511:in `block in invoke_after'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:511:in `each'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:511:in `invoke_after'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:132:in `run_callbacks'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:827:in `_run_commit_callbacks'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/transactions.rb:343:in `committed!'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:86:in `commit_records'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:178:in `block in commit_transaction'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:168:in `commit_transaction'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:207:in `block in within_new_transaction'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/transactions.rb:308:in `block in save'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/transactions.rb:323:in `rollback_active_record_state!'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/transactions.rb:307:in `save'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/suppressor.rb:42:in `save'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activerecord-5.1.6/lib/active_record/persistence.rb:34:in `create'
# ./spec/mailers/user_mailer_messages_spec.rb:91:in `block (2 levels) in <top (required)>'
# ./spec/mailers/user_mailer_messages_spec.rb:89:in `block in <top (required)>'
# ./spec/mailers/user_mailer_messages_spec.rb:3:in `<top (required)>'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `block in load'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:258:in `load_dependency'
# /Users/melsatar/.rvm/gems/ruby-2.4.5/gems/activesupport-5.1.6/lib/active_support/dependencies.rb:286:in `load'