【问题标题】:RoR command "rake routes" abortsRoR 命令“rake routes”中止
【发布时间】:2021-07-07 05:09:18
【问题描述】:

我正在学习 Ruby on Rails 课程。我刚开始我的第一个真正的项目,当我尝试运行时出现错误:

$ rake routes

Error:
Don't know how to build task 'routes' (See the list of available tasks with `rake --tasks`)

(See full trace by running task with --trace)

如果我这样做 $ rake --tasks 'routes' 未列出!

我正在使用 ruby​​ 版本 2.7.3 和 rails 6.1.4

我在网上看了又看,但什么都找不到。

这是我的 routes.rb 文件:

Rails.application.routes.draw do
  root 'home#index'
  get 'home/about'
end

【问题讨论】:

  • 对于所有人:链接说 rake routes 已弃用。使用rails routes@LamPhan 非常感谢!当我搜索了几个小时时,这篇文章没有出现。

标签: ruby-on-rails rake


【解决方案1】:

使用rails routes --expanded

rake routes 已弃用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-02
    • 2017-01-03
    • 1970-01-01
    • 1970-01-01
    • 2011-11-18
    • 1970-01-01
    • 2012-05-21
    • 1970-01-01
    相关资源
    最近更新 更多