不知道如何构建任务“路线”

2024-03-08

我无法执行rake routes即使routes.rb文件为空。这是输出:

➜ rake routes
rake aborted!
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 about:

➜ rake about
About your application's environment
Rails version             6.1.0
Ruby version              ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
RubyGems version          3.1.4
Rack version              2.2.3
Middleware                Webpacker::DevServerProxy, Rack::MiniProfiler, ActionDispatch::HostAuthorization, Rack::Sendfile, ActionDispatch::Static, ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, ActionDispatch::RemoteIp, Sprockets::Rails::QuietAssets, Rails::Rack::Logger, ActionDispatch::ShowExceptions, WebConsole::Middleware, ActionDispatch::DebugExceptions, ActionDispatch::ActionableExceptions, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ContentSecurityPolicy::Middleware, ActionDispatch::PermissionsPolicy::Middleware, Rack::Head, Rack::ConditionalGet, Rack::ETag, Rack::TempfileReaper, Warden::Manager
Application root          /Users/cobexa/app
Environment               development
Database adapter          postgresql
Database schema version   20201219225707

并输出来自rake --tasks:


rake about                              # List versions of all Rails frameworks and the environment
rake action_mailbox:ingress:exim        # Relay an inbound email from Exim to Action Mailbox (URL and INGRESS_PASSWORD required)
rake action_mailbox:ingress:postfix     # Relay an inbound email from Postfix to Action Mailbox (URL and INGRESS_PASSWORD required)
rake action_mailbox:ingress:qmail       # Relay an inbound email from Qmail to Action Mailbox (URL and INGRESS_PASSWORD required)
rake action_mailbox:install             # Installs Action Mailbox and its dependencies
rake action_mailbox:install:migrations  # Copy migrations from action_mailbox to application
rake action_text:install                # Copy over the migration, stylesheet, and JavaScript files
rake action_text:install:migrations     # Copy migrations from action_text to application
rake active_storage:install             # Copy over the migration needed to the application
rake app:template                       # Applies the template supplied by LOCATION=(/path/to/template) or URL
rake app:update                         # Update configs and some other initially generated files (or use just update:configs or update:bin)
rake assets:clean[keep]                 # Remove old compiled assets
rake assets:clobber                     # Remove compiled assets
rake assets:environment                 # Load asset compile environment
rake assets:precompile                  # Compile all the assets named in config.assets.precompile
rake cache_digests:dependencies         # Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake cache_digests:nested_dependencies  # Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)
rake db:create                          # Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:create:all to create all databases in the config). Without RAILS_ENV or when RAILS_ENV is development, it defaults to creating the development and test databases, except when DATABASE_URL is present
rake db:drop                            # Drops the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:drop:all to drop all databases in the config). Without RAILS_ENV or when RAILS_ENV is development, it defaults to dropping the development and test databases, except when DATABASE_URL is present
rake db:environment:set                 # Set the environment value for the database
rake db:fixtures:load                   # Loads fixtures into the current environment's database
rake db:migrate                         # Migrate the database (options: VERSION=x, VERBOSE=false, SCOPE=blog)
rake db:migrate:down                    # Runs the "down" for a given migration VERSION
rake db:migrate:redo                    # Rolls back the database one migration and re-migrates up (options: STEP=x, VERSION=x)
rake db:migrate:status                  # Display status of migrations
rake db:migrate:up                      # Runs the "up" for a given migration VERSION
rake db:prepare                         # Runs setup if database does not exist, or runs migrations if it does
rake db:reset                           # Drops and recreates the database from db/schema.rb for the current environment and loads the seeds
rake db:rollback                        # Rolls the schema back to the previous version (specify steps w/ STEP=n)
rake db:schema:cache:clear              # Clears a db/schema_cache.yml file
rake db:schema:cache:dump               # Creates a db/schema_cache.yml file
rake db:schema:dump                     # Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `config.active_record.schema_format`)
rake db:schema:load                     # Loads a database schema file (either db/schema.rb or db/structure.sql, depending on `config.active_record.schema_format`) into the database
rake db:seed                            # Loads the seed data from db/seeds.rb
rake db:seed:replant                    # Truncates tables of each database for current environment and loads the seeds
rake db:setup                           # Creates the database, loads the schema, and initializes with the seed data (use db:reset to also drop the database first)
rake db:structure:dump                  # Dumps the database structure to db/structure.sql
rake db:structure:load                  # Recreates the databases from the structure.sql file
rake db:version                         # Retrieves the current schema version number
rake log:clear                          # Truncates all/specified *.log files in log/ to zero bytes (specify which logs with LOGS=test,development)
rake middleware                         # Prints out your Rack middleware stack
rake restart                            # Restart app by touching tmp/restart.txt
rake secret                             # Generate a cryptographically secure secret key (this is typically used to generate a secret for cookie sessions)
rake stats                              # Report code statistics (KLOCs, etc) from the application or engine
rake test                               # Runs all tests in test folder except system ones
rake test:all                           # Runs all tests, including system tests
rake test:db                            # Run tests quickly, but also reset db
rake test:system                        # Run system tests only
rake time:zones[country_or_offset]      # List all time zones, list by two-letter country code (`bin/rails time:zones[US]`), or list by UTC offset (`bin/rails time:zones[-8]`)
rake tmp:clear                          # Clear cache, socket and screenshot files from tmp/ (narrow w/ tmp:cache:clear, tmp:sockets:clear, tmp:screenshots:clear)
rake tmp:create                         # Creates tmp directories for cache, sockets, and pids
rake webpacker                          # Lists all available tasks in Webpacker
rake webpacker:binstubs                 # Installs Webpacker binstubs in this application
rake webpacker:check_binstubs           # Verifies that webpack & webpack-dev-server are present
rake webpacker:check_node               # Verifies if Node.js is installed
rake webpacker:check_yarn               # Verifies if Yarn is installed
rake webpacker:clean[keep,age]          # Remove old compiled webpacks
rake webpacker:clobber                  # Remove the webpack compiled output directory
rake webpacker:compile                  # Compile JavaScript packs using webpack for production with digests
rake webpacker:info                     # Provide information on Webpacker's environment
rake webpacker:install                  # Install Webpacker in this application
rake webpacker:install:angular          # Install everything needed for Angular
rake webpacker:install:coffee           # Install everything needed for Coffee
rake webpacker:install:elm              # Install everything needed for Elm
rake webpacker:install:erb              # Install everything needed for Erb
rake webpacker:install:react            # Install everything needed for React
rake webpacker:install:stimulus         # Install everything needed for Stimulus
rake webpacker:install:svelte           # Install everything needed for Svelte
rake webpacker:install:typescript       # Install everything needed for Typescript
rake webpacker:install:vue              # Install everything needed for Vue
rake webpacker:verify_install           # Verifies if Webpacker is installed
rake webpacker:yarn_install             # Support for older Rails versions
rake yarn:install                       # Install all JavaScript dependencies as specified via Yarn
rake zeitwerk:check                     # Checks project structure for Zeitwerk compatibility

我刚刚发现rake routes在 Rails 6.1 上已弃用,取而代之的是rails routes: https://github.com/rails/rails/commit/41ad613e4c5d6c05f20ac0437564ff0d31ab9f5a https://github.com/rails/rails/commit/41ad613e4c5d6c05f20ac0437564ff0d31ab9f5a

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

不知道如何构建任务“路线” 的相关文章

  • 创建一个默认为零的工厂关联?

    在factories rb 文件中使用FactoryGirl gem 如何创建一个关联默认为nil 的工厂 我正在思考以下几点 Factory define user do factory factory association post
  • Rails - 用于集合集的单选按钮

    我有以下输出选择框 br 替代输出单选按钮的 Rails 方法是什么 对于单选按钮 您必须自行迭代并输出每个单选按钮及其标签 事实上这真的很容易
  • 轨道上的下一个对象问题

    视频影像 表 id title votes count 视频影像 控制器 def show video Video find params id next video Video order votes count DESC where v
  • Ruby on Rails:Cucumber:如何点击打开新窗口的链接?

    我有一个在新窗口中打开的链接 我需要测试该新窗口中的应用程序部分 任何建议将不胜感激 定义一个包含以下代码的步骤 page driver browser switch to window page driver browser window
  • ror 中的多种布局

    昨天刚开始使用 Ruby on Rails 在我的 layouts application html erb 中 我有 div class conta div
  • 如何使用 Rails 4 和 Ruby 2.0 应用程序进行实时重新加载?

    如果我在 Rails 4 Ruby 2 0 项目的文本编辑器中编辑 scss 或 erb 文件 我希望在浏览器中看到实时更改 我尝试了 Guard 和 Guard live reload 但它抛出以下错误 22 58 04 ERROR Co
  • 默认:Rails 资源路由的排除选项

    一个小问题 我正在将 Rails 用于 REST API 但由于它是 RESTful API 所以我并不真正需要 new or edit我的任何资源的路由 因为人们只会完全通过自动 JSON 请求而不是图形方式与此 API 交互 例如 不需
  • 如何在 Rails 测试中填充查找表

    我在用Cucumber RSpec and 工厂女工用于测试我的 Rails 应用程序 但我有几个查找表 其中大部分包含static数据 所以我试图找出测试时填充这些的最佳方法 单独做它们FactoryGirl看起来很乏味 我想远离固定装置
  • 何时使用node.js、sinatra、rails? [关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 这 3 种语言 框架的最佳用途是什么 混合所有 或 2 个 有用吗 如果您正在构建一个完整的 Web 应用程序 您可能应该使用 Rails 因为
  • ruby 管道、IO 和 stderr 重定向

    我希望有一个 ruby 程序 一个 rake 任务 观察另一个 rake 任务的输出 输出写入器输出到 stderr 我想读一下这些行 我很难设置它 如果我有一个作家 stdout writer rb 不断打印一些东西 usr bin en
  • 如何在 Ruby 中创建自定义排序方法

    我想指定一个自定义块方法 通过评估两个属性来对对象数组进行排序 然而 经过多次搜索 我没有找到任何没有的例子 lt gt 操作员 我想比较a to b if a x less than b x return 1 if a x greater
  • 在 postgresql 中查找和汇总具有重叠记录的日期范围

    我有一个大型数据集 我想对记录具有重叠时间的计数进行求和 例如 给定数据 id 1 name A start 2018 12 10 00 00 00 end 2018 12 20 00 00 00 count 34 id 2 name B
  • NameError:未初始化的常量 Gem::SourceIndex

    对于没有任何修改的新 Rails 应用程序 在访问主页时 成功运行后 会出现此错误bundle install 以下是版本号 ruby 1 9 3p392 2013 02 22 revision 39386 x86 64 darwin12
  • 有没有办法避免自动更新 Rails 时间戳字段?

    如果您有数据库列created at and updated at当您创建和更新模型对象时 Rails 将自动设置这些值 有没有办法在不接触这些列的情况下保存模型 我正在引入一些旧数据 我想根据 不同名称的 旧数据字段中的相应值设置这些值
  • URL 路由中的点与命名空间 Rails 3.1

    我有这个路线 rb root to gt posts index devise for users controllers gt omniauth callbacks gt users omniauth callbacks resource
  • Devise:允许用户注册为“UsErNaMe”但使用“用户名”登录

    与大多数网站的工作方式相同 我将 UsErNaMe 存储在数据库中 但让用户使用 用户名 登录 这是一个相当明显且必要的功能 很多人似乎都问过它 但我不断遇到的解决方案似乎与 Devise 自己的文档脱节 例如 考虑这篇博文 http an
  • 我应该如何使用 alias_method_chain 作为构建方法?

    我正在使用 Ruby on Rails 3 2 13 我想正确使用alias method chain build option name声明 因为我收到一个奇怪的错误 那是 在我的控制器文件中我有 class Articles Comme
  • Rails content_for 和yield 之间有什么区别?

    例如 content for stuff vs yield stuff 我知道它们的实现略有不同 但是有任何真正的功能差异吗 是否有普遍接受的最佳实践 yield是您指定内容区域在布局中的位置的方式 你可能有这样的事情 div h1 Thi
  • “heroku”命令存在于以下 Ruby 版本中:

    我在使用 heroku 工具带时遇到了重大问题 我正在使用 cedar 14 堆栈 当我尝试使用不是的 ruby 版本时ruby 2 0 0 dev我收到这个错误 rbenv heroku command not found The her
  • Rails:Passenger Standalone 适合生产部署吗?

    问题标题几乎概括了这一点 我找不到任何好的资源来概述使用 Phusion Passenger Standalone 进行 Rails 应用程序部署的优点 缺点 它与运行 Passenger Nginx 或 Passenger Apache

随机推荐

  • 短信 url 方案不适用于 IOS5

    在我的针对 iphone 和 android 的网络应用程序中 我有一个 发短信给我 按钮 单击该按钮后 用户会收到预先填写了号码和正文的短信 这在 ios 5 之前的 iphone 中运行良好 在IOS 5中 点击按钮不会导致短信应用 I
  • C++ 默认构造函数缺失,我无法编译

    我有这个非常简单的课程 class myclass public int id double x y z myclass default If I omit this line I get an error myclass int ID d
  • iPhone - 时区便利方法之间的差异

    我看到NSTimeZone有这些方法 defaultTimeZone localTimeZone systemTimeZone 有人可以简单地向我解释一下这些调用之间有什么区别 以及何时应该使用其中一个而不是另一个 我不明白苹果文档中关于此
  • 如何在使用 STS (WIF) 进行身份验证的 MVC 应用程序中设置滑动过期

    我们正在使用 STS 开发一个 MVC 应用程序 我们使用 WIF 工具创建了一个简单的 STS 应用程序进行开发 我希望能够在我的令牌 在 RP 中 中设置滑动到期时间 我看到代码像这儿 http social msdn microsof
  • Spark 流自定义指标

    我正在开发一个 Spark Streaming 程序 它检索 Kafka 流 对流进行非常基本的转换 然后将数据插入到数据库 如果相关 则为 voltdb 我正在尝试测量向数据库插入行的速率 我认为metrics http metrics
  • 通过配置强制在 WCF 客户端 C# 中使用 tls 1.0

    我们有一个 Web 应用程序 其中有一个使用 WCF 实现的客户端 该客户端使用 SSL LVL3 与外部服务进行握手 原来该服务只是禁用了SSL LVL3 所以我们需要将其更改为TLS 1 0 有一种方法可以在 C 中强制使用 TLS 安
  • 为什么 `myfloat in myset` 变得超级慢?

    当我重新插入相同的float值进入我的设置几次 x in s本来应该花费恒定时间的检查变得非常慢 为什么 定时输出x in s 0 06 microseconds 0 09 microseconds 0 16 microseconds 0
  • 在 React Form 中更新 props 变化的状态

    我在使用 React 表单和正确管理状态时遇到问题 我在表单 模态 中有一个时间输入字段 初始值设置为状态变量getInitialState 并从父组件传入 这本身就很好用 当我想通过父组件更新默认的 start time 值时 问题就出现
  • sed — 连接一系列选定的行

    我是初学者sed 我知道可以将一个命令 或一组命令 应用于一定范围的行 如下所示 sed begin end some command where begin 是一个正则表达式 指定范围的起始行并且 end 是一个正则表达式 指定范围的结束
  • 如何要求电子邮件的收件人在其回复下方添加“-- 在本行上方回复 --” 标签?

    我想解析传入的电子邮件 这是对我发送的电子邮件的回复 的实际消息 没有 原始消息 部分 签名等 为了实现这一点 我想在回复中包含一个分隔符 例如 在本行上方回复 就像我读过的许多帖子中建议的那样 但是 当用户回复我的一封电子邮件时 如何要求
  • .NET 部署 Office 2003 可再发行主互操作程序集 (o2003pia.msi)

    有没有人真正成功地为 o2003 msi 创建先决条件 有一个lot很多人问这个问题 但我找不到真正成功的人 我发现一些极其复杂的解决方案 您需要完成可能提供也可能不提供源的 cpp 文件 我什至尝试遵守其中之一 但在目标计算机上出现配置错
  • 如何将事件分发到(Wildfly)集群中的所有节点?

    当我的进程中运行时间较长的进程的状态时 我想通知集群中的所有节点JavaEE 7WebApp 发生变化 因此每个节点都可以通过 WebSocket 依次通知其客户端该变化 我正在集群环境中使用 Wildfly 10 What JavaEE
  • 使用 JSF 暂时抑制 beanvalidation

    我有一个用户类 其中包含电子邮件地址和密码字段 NotNull Size min 6 Pattern flags Pattern Flag CASE INSENSITIVE regexp private String password nu
  • jquery .animate 不同的速度

    我正在 Jquery 中使用 animate 函数 我有一个使用 marginLeft 滑动的 div 但我也需要它淡入 但我需要它比 marginLeft 效果慢 对于 animate 我似乎只能应用一个速度参数
  • 在reactjs材料ui进度条中显示百分比数字

    I use 线性确定 https material ui com demos progress 我想显示完成了多少进度 就像下图一样 我不认为 Material UI 提供进度条 如上图所示 但是 您可以使用 React Bootstrap
  • 如何将表标记为只读?

    我正在处理 django 站点的迁移 我想将除 django session 表之外的所有表设为只读 我怎样才能做到这一点 REVOKE INSERT UPDATE DELETE TRUNCATE ON ALL TABLES IN SCHE
  • MVC5 Ajax.BeginForm刷新整个页面

    为什么表单发布没有通过 ajax 发生 而是重新加载到新页面 我的 js 包括 我的剃须刀观点 div using Ajax BeginForm Login null new AjaxOptions div
  • 在主程序之前在 lambda 中加载 S3 文件

    我正在编写一个 lambda 函数 需要加载存储在 S3 中的密钥 它不会经常改变 所以我不想每次调用 lambda 函数时都获取它 所以我想在容器旋转时加载它一次 然后在 lambda 容器的生命周期内保留该值 但是 由于异步方法 get
  • haproxy:获取主机名

    我正在尝试获取请求者主机 IP 因为它涉及 haproxy 节点 我的 haproxy 配置如下 frontend www http bind 9000 http request redirect location https fi 914
  • 不知道如何构建任务“路线”

    我无法执行rake routes即使routes rb文件为空 这是输出 rake routes rake aborted Don t know how to build task routes See the list of availa