Sreekar Maganti
Sreekar Maganti

Reputation: 3

LoadError while running rails active_storage:install

I am new to ruby on rails and am trying to build a basic todo-list app. My ruby version is 2.5.5 and Rails version is 5.1.7. I am trying to setup active_storage in my application but am unable to run the command rails active_storage:install. I am on a Windows 8.1 x64 system.

This is the error trace:

C:\Users\Sreekar\Documents\GitHub\todo-app>rails active_storage:install --trace
rails aborted!
LoadError: cannot load such file -- active_storage/engine
C:/Users/Sreekar/Documents/GitHub/todo-app/config/application.rb:4:in `require'
C:/Users/Sreekar/Documents/GitHub/todo-app/config/application.rb:4:in `<top (required)>'
C:/Users/Sreekar/Documents/GitHub/todo-app/Rakefile:4:in `require_relative'
C:/Users/Sreekar/Documents/GitHub/todo-app/Rakefile:4:in `<top (required)>'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.3/lib/rake/rake_module.rb:29:in `load'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.3/lib/rake/rake_module.rb:29:in `load_rakefile'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.3/lib/rake/application.rb:703:in `raw_load_rakefile'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.3/lib/rake/application.rb:104:in `block in load_rakefile'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.3/lib/rake/application.rb:103:in `load_rakefile'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/rake-12.3.3/lib/rake/application.rb:186:in `standard_exception_handling'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/commands/rake/rake_command.rb:18:in `perform'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/command.rb:46:in `invoke'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.7/lib/rails/commands.rb:16:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

I have already tried to include require active_storage/engine in my config/application.rb file but it isn't working.

These are the contents of my application.rb file:

require_relative 'boot'
require 'rails/all'
require 'active_storage/engine'

Bundler.require(*Rails.groups)

module TodoApp
class Application < Rails::Application
config.load_defaults 5.1

I need to create 2 tables in my schema: active_storage_blobs and active_storage_attachments upon running rails db:migrate. Would appreciate any help regarding how to get this to work. Thanks!

Upvotes: 0

Views: 377

Answers (1)

user11831257
user11831257

Reputation:

Active storage is supported and comes in default from Rails versions >= 5.2. Your Rails version is 5.1.7.

So, you should consider upgrading your app to Rails 5.2(See this link) to use Active storage.

Upvotes: 1

Related Questions