activeadmin with rails API app errors: ArgumentError in Admin::DashboardController#index
<p>I am trying to incorporate <a href="https://github.com/activeadmin/activeadmin" rel="nofollow">active admin</a> with a <a href="https://github.com/rails-api/rails-api" rel="nofollow">rails_api</a> app.</p>

<p><strong>Details:</strong></p>

<p>Because it is an API, with no cookies and stuffs, I am using <a href="https://github.com/lynndylanhurley/devise_token_auth" rel="nofollow">devise_auth_token</a> for authentication ( not <a href="https://github.com/plataformatec/devise" rel="nofollow">devise</a> ).</p>

<p>The authentication is working perfectly. However, I'm now trying to incorporate <a href="https://github.com/activeadmin/activeadmin" rel="nofollow">active admin</a> with this, and followed the steps:</p>

<pre><code>gem 'activeadmin', '1.0.0.pre2'
$ bundle install
$ rails g active_admin:install 
$ rake db:migrate db:seed
$rails server
</code></pre>

<p>On going to <a href="http://localhost:3000/admin" rel="nofollow">http://localhost:3000/admin</a>, it blew up with following error:</p>

<pre><code>ArgumentError in Admin::DashboardController#index
wrong number of arguments (given 1, expected 0)
</code></pre>

<p>pointing to a line: <code>define_method(name) do</code> in: </p>

<pre><code> if instance_reader
    remove_possible_method name
    define_method(name) do
      if instance_variable_defined?(ivar)
        instance_variable_get ivar
      else
</code></pre>

<p>Note however that going directly to <a href="http://localhost:3000/admin/login" rel="nofollow">http://localhost:3000/admin/login</a> opens the login page, but after login, it redirects back to <a href="http://localhost:3000/admin" rel="nofollow">http://localhost:3000/admin</a> with same error message.</p>

<p><strong>Gemfile:</strong></p>

<pre><code>gem 'pg'
gem 'devise'
gem 'devise_token_auth'
gem 'omniauth'
gem 'money-rails'
gem 'swagger-docs'
gem 'activeadmin', '1.0.0.pre2'gem 'pg'
gem 'devise'
gem 'devise_token_auth'
gem 'omniauth'
gem 'money-rails'
gem 'swagger-docs'
gem 'activeadmin', '1.0.0.pre2'
</code></pre>

<p><strong>Routes.rb:</strong></p>

<pre><code>Rails.application.routes.draw do
  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)
  namespace :api do
    namespace :v1 do
      mount_devise_token_auth_for 'User', at: 'auth'
      ...
    end
  end
  root to: "home#index"
end
</code></pre>

<p><strong>Dependencies:</strong></p>

<ul>
<li>Ruby: 2.3.0</li>
<li>Rails: 4.2.4</li>
<li>Active Admin: 1.0.0.pre2</li>
<li>Rails API: 0.4.0</li>
<li>Devise: 3.5.6</li>
<li>Devise token auth: 0.1.37</li>
</ul>

<p><strong>Stack trace:</strong></p>

<pre><code>ArgumentError (wrong number of arguments (given 1, expected 0)):
  activesupport (4.2.4) lib/active_support/core_ext/class/attribute.rb:106:in `block (2 levels) in class_attribute'
  devise_token_auth (0.1.37) app/controllers/devise_token_auth/concerns/set_user_by_token.rb:21:in `set_user_by_token'
  devise_token_auth (0.1.37) lib/devise_token_auth/controllers/helpers.rb:117:in `current_admin_user'
  devise_token_auth (0.1.37) lib/devise_token_auth/controllers/helpers.rb:105:in `authenticate_admin_user!'
  activeadmin (1.0.0.pre2) lib/active_admin/base_controller.rb:39:in `authenticate_active_admin_user'
  activesupport (4.2.4) lib/active_support/callbacks.rb:432:in `block in make_lambda'
  activesupport (4.2.4) lib/active_support/callbacks.rb:164:in `block in halting'
  activesupport (4.2.4) lib/active_support/callbacks.rb:504:in `block in call'
  activesupport (4.2.4) lib/active_support/callbacks.rb:504:in `each'
  activesupport (4.2.4) lib/active_support/callbacks.rb:504:in `call'
  activesupport (4.2.4) lib/active_support/callbacks.rb:92:in `__run_callbacks__'
  activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
  activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.4) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.2.4) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.2.4) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.4) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.4) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (4.2.4) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.2.4) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.2.4) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.2.4) lib/abstract_controller/base.rb:137:in `process'
  actionview (4.2.4) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.2.4) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.2.4) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.2.4) lib/action_controller/metal.rb:237:in `block in action'
  actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:76:in `dispatch'
  actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:45:in `serve'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.4) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.4) lib/action_dispatch/routing/route_set.rb:821:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/flash.rb:260:in `call'
  warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.6) lib/warden/manager.rb:34:in `catch'
  warden (1.2.6) lib/warden/manager.rb:34:in `call'
  rack (1.6.4) lib/rack/etag.rb:24:in `call'
  rack (1.6.4) lib/rack/conditionalget.rb:25:in `call'
  rack (1.6.4) lib/rack/head.rb:13:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  activerecord (4.2.4) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
  activerecord (4.2.4) lib/active_record/migration.rb:377:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
  activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
  activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
  railties (4.2.4) lib/rails/engine.rb:518:in `call'
  railties (4.2.4) lib/rails/application.rb:165:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  rack (1.6.4) lib/rack/content_length.rb:15:in `call'
  rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
  /Users/Sunday/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
  /Users/Sunday/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
  /Users/Sunday/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'
</code></pre>

<p>I am suspecting it may have to do with the fact that <code>rails_api</code> does not include several rails middleware by default... but really, I don't know what it is, or how I can go about it. Please anyone, I need help on this.</p>

<p>Will my combination even work at all?</p>