- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法执行 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
关于ruby-on-rails - 不知道如何构建任务 'routes',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65375391/
您好,如果没有身份验证,我尝试保护路由,但它不起作用 警告:您不应在同一个 route 使用路线组件和路线渲染;路线渲染将被忽略 App.js import React, { Fragment,
几乎我见过的每个示例,app.js 都使用 require 和路径 ./。我想知道为什么我们不能只使用 /。例如,为什么我们不能执行以下操作。 var express = require('expre
如果router.all()只匹配所有方法,是否可以用router.use()代替?router.use() 和 router.route() 之间有什么区别? 最佳答案 router.all:这意味
在我的 Symfony应用程序我想根据当前用户的文化选择 routing.yml; 'en' => routing.en.yml 'no' => routing.no.yml 等等。 关于如何做到这一
我正在使用 React Router v6 并为我的应用程序创建私有(private)路由。 在文件 PrivateRoute.js 中,我有代码 import React from 'react';
这个问题在这里已经有了答案: Error "Error: A is only ever to be used as the child of element" (14 个回答) Error: [P
我正在关注 Ember Quick Start guide (ember-cli v 2.11),并按照说明构建玩具应用程序。在“定义路线”部分,说明说要运行命令 ember generate rou
这个问题在这里已经有了答案: ReactJS: [Home] is not a component. All component children of must be a or (5 个答
这个问题在这里已经有了答案: ReactJS: [Home] is not a component. All component children of must be a or (5 个答
单击“开始测验”按钮时,我试图导航到“/quiz”。 但是,当我编译我的代码时,我在网站应用程序上收到以下错误:[Home] is not a component. All component ch
我有一点咸菜。我正在使用路由保护(实现 CanActivate 接口(interface))来检查用户是否被授予访问特定路由的权限: const routes: Routes = [ {
我正在尝试测试我的应用程序正在使用的引擎内部的 Controller 。规范不在引擎中,而是在应用程序本身中(我试图在引擎中进行测试,但也遇到了问题)。 我的引擎有以下 routes.rb: Revi
我是Remix的新手,我正在尝试使用V2路由方法实现特定的路由解决方案。。这是一个人为的例子,不是真实的东西,只是为了说明这一点。。我想要的URL方案是:。我从以下几条路线开始:。App/routes
我正在尝试从 rails 2.3.x(使用 subdomain_routes 插件)转换一些子域路由,如下所示: map.subdomain :biz do |biz| biz.resources
我将 Symfony 的 3.1 路由组件用作独立组件。 我想调试路由。 据此: http://symfony.com/doc/current/routing/debug.html 这是通过运行以下命
我是 Sparkjava 的新手,总体上喜欢它。但是,是否必须在 main 方法中定义新的路由/端点?对于任何重要的 Web 应用程序,这将导致一个非常长的 main 方法,或者我需要有多个 main
我刚刚使用node.js 和express.js 开发了一个原型(prototype)。在这里,我使用了 Express 路由来对后端进行 CRUD。 server.js 文件: app.get('/
我不明白 Angular 4 中路由的一些基本概念。 index.html: 文件结构: - app |- app.routings.ts |- collections |-- collection
我在反应路线和理解合成路线方面遇到了一些困难。我尝试了一些代码,但不幸的是,它不能像预期的那样工作。“/”路径运行得很好,但是,当我尝试访问“/Child”时,它似乎不起作用。我认为包装器路由}/>可
我正在尝试使用 cakephp 3 实现 REST api。 为了给我的问题提供一个易于重现的示例,我从全新安装 cakephp 3.1.11 开始。 在 config/routes.php 中,我添
我是一名优秀的程序员,十分优秀!