title: rails active_storage:install IS NOT WORKING
body: <p>I have updated my rails api application from 5.1 to 5.2. 
  I am using rails api only.
  I am trying to use the active storage. I think the problem is due to the line <code>config.api_only = true</code> in <code>config/application.rb</code>.</p>
  
  <p>I did lot of google but did not find any thing how to use active storage in rails api.</p>
  
  <p>Here is my <code>Gemfile</code>:</p>
  
  <pre><code>source 'https://rubygems.org'
  
  ruby '2.5.1'
  
  git_source(:github) do |repo_name|
    repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
    "https://github.com/#{repo_name}.git"
  end
  
  gem 'rails', '~&gt; 5.2.0'
  gem 'pg', '&gt;= 0.18', '&lt; 2.0'
  gem 'puma', '~&gt; 3.7'
  gem 'rack-cors'
  
  # Auth
  gem 'bcrypt'
  gem 'jwt'
  
  #Media file upload
  gem 'activestorage'
  
  # gem 'devise', '4.4.3'
  # gem 'devise-jwt', '~&gt; 0.5.6'
  gem 'active_model_serializers', '~&gt; 0.10.0', require: true
  
  # backgroud jobs
  gem 'sidekiq'
  
  # fast boot
  gem 'bootsnap', require: false
  
  group :development, :test do
    gem 'rspec-rails', '~&gt; 3.7'
    gem 'brakeman'
    gem 'rubocop'
    gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  end
  
  group :development do
    gem 'foreman'
    gem 'listen', '&gt;= 3.0.5', '&lt; 3.2'
    gem 'spring'
    gem 'pry'
    gem 'spring-watcher-listen', '~&gt; 2.0.0'
    gem 'annotate'
  end
  
  # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
  gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
  </code></pre>
  
  <p>Here is my <code>config/application.rb</code></p>
  
  <pre><code>require_relative 'boot'
  
  require "rails"
  # Pick the frameworks you want:
  require "active_model/railtie"
  require "active_job/railtie"
  require "active_record/railtie"
  require "action_controller/railtie"
  require "action_mailer/railtie"
  require "action_view/railtie"
  require "action_cable/engine"
  require "active_storage"
  # require "sprockets/railtie"
  require "rails/test_unit/railtie"
  
  # Require the gems listed in Gemfile, including any gems
  # you've limited to :test, :development, or :production.
  Bundler.require(*Rails.groups)
  
  module CelebrationBackend
    class Application &lt; Rails::Application
      # Initialize configuration defaults for originally generated Rails version.
      config.load_defaults 5.1
  
      # Settings in config/environments/* take precedence over those specified here.
      # Application configuration should go into files in config/initializers
      # -- all .rb files in that directory are automatically loaded.
  
      # Only loads a smaller set of middleware suitable for API only apps.
      # Middleware like session, flash, cookies can be added back manually.
      # Skip views, helpers and assets when generating a new resource.
      config.api_only = true
  
      config.active_job.queue_adapter = :sidekiq
      config.autoload_paths &lt;&lt; Rails.root.join('lib')
    end
  end
  </code></pre>
  
  <p>While running the <code>rails activestorage:install</code> in to console.
  I am getting the following error:</p>
  
  <p>rails aborted!
  Don't know how to build task 'activestorage:install' (see --tasks)
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:23:in <code>block in perform'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/railties-5.2.0/lib/rails/commands/rake/rake_command.rb:20:in</code>perform'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/railties-5.2.0/lib/rails/command.rb:48:in <code>invoke'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/railties-5.2.0/lib/rails/commands.rb:18:in</code>'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in <code>require'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in</code>block in require_with_bootsnap_lfi'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in <code>register'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in</code>require_with_bootsnap_lfi'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in <code>require'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in</code>block in require'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in <code>load_dependency'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in</code>require'
  /home/sourabh/dev/celebration/bin/rails:9:in <code>&lt;top (required)&gt;'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in</code>load'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in <code>call'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/spring-2.0.2/lib/spring/client/command.rb:7:in</code>call'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/spring-2.0.2/lib/spring/client.rb:30:in <code>run'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/spring-2.0.2/bin/spring:49:in</code>'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/spring-2.0.2/lib/spring/binstub.rb:31:in <code>load'
  /home/sourabh/.rvm/gems/ruby-2.5.1@celeb/gems/spring-2.0.2/lib/spring/binstub.rb:31:in</code>'
  /home/sourabh/dev/celebration/bin/spring:15:in <code>require'
  /home/sourabh/dev/celebration/bin/spring:15:in</code>'
  bin/rails:3:in <code>load'
  bin/rails:3:in</code>'
  (See full trace by running task with --trace)</p>
  
  <p>I am not getting the exact thing what I am doing wrong.</p>