【问题标题】:rails active_storage:install gives errorrails active_storage:install 给出错误
【发布时间】:2019-01-04 22:20:41
【问题描述】:

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

我正在尝试学习有关主动存储的教程

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

我在 MacOS 上

我做 rails new blahapp cd blahapp 所以一个全新的 Rails 应用程序。

我得到了错误

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

看到这些问题rails active_storage:install IS NOT WORKINGhttps://github.com/rails/activestorage/tree/archive#installation

我尝试了那里的东西,但仍然无法正常工作,我会详细说明..

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

同样的错误

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

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

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

"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

【问题讨论】:

  • 你使用的是什么版本的 ruby​​ / rails?
  • @rosalynn rails 5.1.6, Ruby 2.5.0p0

标签: ruby-on-rails macos rails-activestorage


【解决方案1】:

由于在 Rails 5.2 中引入了主动存储,您需要使用该版本才能使其工作。尝试运行“gem install rails”或(请参阅完整的更新说明here)然后创建一个新应用程序并照常按照说明进行操作。

【讨论】:

  • 谢谢,我刚刚尝试编辑 Gemfile 并将 rails 版本更改为 5.2.0 ,进行包更新,然后 rails active_storage:install 没有错误。
猜你喜欢
  • 1970-01-01
  • 2017-09-26
  • 1970-01-01
  • 2011-10-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-26
  • 2023-03-18
相关资源
最近更新 更多