LoadError while 运行 rails active_storage:install
LoadError while running rails active_storage:install
我是 rails 上 ruby 的新手,我正在尝试构建一个基本的待办事项列表应用程序。我的 ruby 版本是 2.5.5
,Rails 版本是 5.1.7
。我正在尝试在我的应用程序中设置 active_storage
,但无法 运行 命令 rails active_storage:install
。我在 Windows 8.1 x64 系统上。
这是错误轨迹:
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>'
我已经尝试将 require active_storage/engine
包含在我的 config/application.rb
文件中,但它不起作用。
这些是我的 application.rb
文件的内容:
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
我需要在我的架构中创建 2 个表:active_storage_blobs
和 active_storage_attachments
运行 宁 rails db:migrate
。
将不胜感激关于如何让它工作的任何帮助。谢谢!
支持活动存储,默认来自 Rails 版本 >= 5.2
。您的 Rails 版本是 5.1.7
.
因此,您应该考虑将您的应用升级到 Rails 5.2
(See this link) 以使用活动存储。
我是 rails 上 ruby 的新手,我正在尝试构建一个基本的待办事项列表应用程序。我的 ruby 版本是 2.5.5
,Rails 版本是 5.1.7
。我正在尝试在我的应用程序中设置 active_storage
,但无法 运行 命令 rails active_storage:install
。我在 Windows 8.1 x64 系统上。
这是错误轨迹:
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>'
我已经尝试将 require active_storage/engine
包含在我的 config/application.rb
文件中,但它不起作用。
这些是我的 application.rb
文件的内容:
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
我需要在我的架构中创建 2 个表:active_storage_blobs
和 active_storage_attachments
运行 宁 rails db:migrate
。
将不胜感激关于如何让它工作的任何帮助。谢谢!
支持活动存储,默认来自 Rails 版本 >= 5.2
。您的 Rails 版本是 5.1.7
.
因此,您应该考虑将您的应用升级到 Rails 5.2
(See this link) 以使用活动存储。