Rails 5 Upgrade: /actionpack-5.0.0/lib/action_controller/test_case.rb: 49: in `initialize ': invalid number of arguments (0 for 2) (ArgumentError)

I recently worked with a Rails 5 update, and I run this error when I try to start the rails console:

/actionpack-5.0.0/lib/action_controller/test_case.rb:49:in initialize': wrong number of arguments (0 for 2) (ArgumentError)

Currently, bundle update rails completed work with gem dependencies that are allowed enough to upgrade to 5.0.0, rspec works (albeit with a lot of interruptions, which I fix). I can also run rails s without errors.

Here is the line break code:

https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/test_case.rb

Full stack:

/Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/actionpack-5.0.0/lib/action_controller/test_case.rb:49:in `initialize': wrong number of arguments (0 for 2) (ArgumentError) from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/draper-2.1.0/lib/draper/view_context/build_strategy.rb:41:in `new' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/draper-2.1.0/lib/draper/view_context/build_strategy.rb:41:in `block in controller' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/draper-2.1.0/lib/draper/view_context/build_strategy.rb:40:in `tap' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/draper-2.1.0/lib/draper/view_context/build_strategy.rb:40:in `controller' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/draper-2.1.0/lib/draper/view_context/build_strategy.rb:30:in `call' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/draper-2.1.0/lib/draper/view_context.rb:49:in `build' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/draper-2.1.0/lib/draper/railtie.rb:63:in `block in <class:Railtie>' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/railtie.rb:226:in `call' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/railtie.rb:226:in `block in run_console_blocks' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/railtie.rb:247:in `each' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/railtie.rb:247:in `each_registered_block' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/railtie.rb:226:in `run_console_blocks' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/application.rb:463:in `block in run_console_blocks' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/engine/railties.rb:13:in `each' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/engine/railties.rb:13:in `each' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/application.rb:463:in `run_console_blocks' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/engine.rb:442:in `load_console' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/commands/console.rb:34:in `initialize' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/commands/console_helper.rb:9:in `new' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/commands/console_helper.rb:9:in `start' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:78:in `console' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!' from /Users/this_is_my_username/.rvm/gems/ruby-2.2.3/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>'

+6
source share
1 answer

Kudos to Scott W.

The problem basically answered here: Ruby on Rails 5.0 update does not work with rab or db: migrate console

I want to clarify that gem 'draper', github: 'drapergem/draper', branch: 'rails-5' no longer works, but gem 'draper', github: 'audionerd/draper', branch: 'rails5' really worked to fix this error.

+4
source

All Articles