rails active_storage:install给出错误 [英] rails active_storage:install gives error

查看:83
本文介绍了rails active_storage:install给出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意-还有其他一些问题似乎也要问同样的事情,但是那里的解决方案对我不起作用.所以这有点不同.

Note- there are some other questions that seem to ask the same thing, but the solutions there dont work for me. So this is a bit different.

我正在尝试阅读有关活动存储的教程

I'm trying to go through a tutorial on active storage

https://edgeguides.rubyonrails.org/active_storage_overview.html

我在MacOS上

我这样做是rails new blahapp cd blahapp,所以是新鲜的Rails应用程序.

I do rails new blahapp cd blahapp so a fresh rails application.

我得到了错误

Don't know how to build task 'active_storage:install'

看到了以下问题 rails active_storage:安装不起作用 https://github.com/rails/activestorage/tree/archive#installation

我尝试了其中的内容,但仍然无法正常工作,我会详细说明.

I tried what's there and it's still not working, i'll elaborate..

然后我尝试将gem "activestorage"添加到Gemfile中,并进行捆绑安装

I then tried adding gem "activestorage" to Gemfile, and did bundle install

相同错误

然后我尝试打开文件config/application.rb并添加行require "active_storage",然后错误有所改变

I then tried opening the file config/application.rb and adding the line require "active_storage" Then the error changed a little bit

"Don't know how to build task 'active_storage:install'.......... did you mean? activestorage:install

所以,即使指南说rails active_storage:install我也尝试了rails activestorage:install并说了

So, even though the guide says rails active_storage:install I tried rails activestorage:install and it said

"Made storage and tmp/storage directories for development and testing.  
Copied default configuration to config/storage_serivces.ymp
rails aborted.
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/apple/blahapp/db/migrate/.............active_storage_create_tables.rb

推荐答案

由于Rails 5.2中引入了活动存储,因此您需要使用该版本才能正常工作.尝试运行宝石安装导轨"或(请参见完整更新说明此处),然后创建一个新应用并按照说明进行操作.

Since active storage was introduced in Rails 5.2, you need to be using that version for it to work. Try running "gem install rails" or (see full update instructions here) then creating a new app and following the instructions as usual.

这篇关于rails active_storage:install给出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆