为什么 Rails 命令强制显示“new”命令的帮助消息?

2024-01-04

奇怪的是,在某些情况下我无法执行典型的 Rails 命令,例如rails s and rails c.

我发现这种情况发生在某个功能分支上,过去也偶尔发生过,但目前适用于我的develop branch.

我逆转了任何.rb可以加载并产生任何效果的文件,但这没有帮助,其他更改是.sh文件和自述文件更新。

我不想看到的文字:

> rails
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /Users/jsmall/.rvm/rubies/ruby-2.1.5/bin/ruby
  -b, [--builder=BUILDER]                                # Path to a application builder (can be a filesystem path or URL)
  -m, [--template=TEMPLATE]                              # Path to an application template (can be a filesystem path or URL)
      [--skip-gemfile], [--no-skip-gemfile]              # Don't create a Gemfile
      [--skip-bundle], [--no-skip-bundle]                # Don't run bundle install
  -G, [--skip-git], [--no-skip-git]                      # Skip Git ignores and keeps
  -O, [--skip-active-record], [--no-skip-active-record]  # Skip Active Record files
  -S, [--skip-sprockets], [--no-skip-sprockets]          # Skip Sprockets files
  -d, [--database=DATABASE]                              # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                                         # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]                          # Preconfigure for selected JavaScript library
                                                         # Default: jquery
  -J, [--skip-javascript], [--no-skip-javascript]        # Skip JavaScript files
      [--dev], [--no-dev]                                # Setup the application with Gemfile pointing to your Rails checkout
      [--edge], [--no-edge]                              # Setup the application with Gemfile pointing to Rails repository
  -T, [--skip-test-unit], [--no-skip-test-unit]          # Skip Test::Unit files
      [--old-style-hash], [--no-old-style-hash]          # Force using old style hash (:foo => 'bar') on Ruby >= 1.9

Runtime options:
  -f, [--force]                    # Overwrite files that already exist
  -p, [--pretend], [--no-pretend]  # Run but do not make any changes
  -q, [--quiet], [--no-quiet]      # Suppress status output
  -s, [--skip], [--no-skip]        # Skip files that already exist

Rails options:
  -h, [--help], [--no-help]        # Show this help message and quit
  -v, [--version], [--no-version]  # Show Rails version number and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

    You can specify extra command-line arguments to be used every time
    'rails new' runs in the .railsrc configuration file in your home directory.

    Note that the arguments specified in the .railsrc file don't affect the
    defaults values shown above in this help message.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.

我想看的文字:

> rails
Usage: rails COMMAND [ARGS]

The most common rails commands are:
 generate    Generate new code (short-cut alias: "g")
 console     Start the Rails console (short-cut alias: "c")
 server      Start the Rails server (short-cut alias: "s")
 dbconsole   Start a console for the database specified in config/database.yml
             (short-cut alias: "db")
 new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:
 application  Generate the Rails application code
 destroy      Undo code generated with "generate" (short-cut alias: "d")
 benchmarker  See how fast a piece of code runs
 profiler     Get profile information from a piece of code
 plugin       Install a plugin
 runner       Run a piece of code in the application environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information.

我发现我的应用程序的根目录中没有 bin 文件夹。快速修复:

bundle exec rake rails:update:bin

对 Pradeep 的支持:
Rails 服务器无法通过命令“Rails s”启动 https://stackoverflow.com/questions/10054406/rails-server-does-not-start-by-command-rails-s/23090423#23090423

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

为什么 Rails 命令强制显示“new”命令的帮助消息? 的相关文章

随机推荐

  • 如何使用 Visual Studio 2019 构建 GTK+ 应用程序?

    我按照上所述安装了 GTK 3 0https www gtk org download windows php https www gtk org download windows php我克隆了 git 并输入vcpkg install
  • 关于集群和群体算法有哪些好的资源?

    前段时间看了小说Prey https rads stackoverflow com amzn click com 0066214122 尽管这绝对是有趣的科幻小说领域 但它激起了我对群体人工智能的兴趣 我最近在 Reddit 上看到了这些演
  • 当每 4 分钟发送一次保持活动请求时,Azure Functions 在消耗计划中仍处于“冷启动”状态

    我已经读过了解无服务器冷启动 Azure 应用服务团队博客 https blogs msdn microsoft com appserviceteam 2018 02 07 understanding serverless cold sta
  • 将列添加到动物园对象

    我有一个动物园对象z10行2列如下 Date Return 1986 01 0 00308215260513781 1986 02 0 00305355599484584 1986 10 0 00349830477430457 我需要一个n
  • 在 Unity 中重复音频剪辑,间隔越来越小

    我希望倒计时器在倒计时时滴答得更快 滴答声 是一个非常短的音频片段 我已经让计时器工作了 它每帧都会调用 playTickManager 然而 通过此实现 在取消 重新调用的某些转换中 滴答声之间的间隙不一致或重叠 导致滴答声听起来不自然
  • 如何测试 Intuit 重新连接 api?

    我正在构建一个页面 该页面将向 Intuit Reconnect API 发送请求以更新 Oauth 令牌和令牌秘密值 这是工作 但我的测试 Oauth 值不在过期 30 天内 因此 响应始终是 令牌刷新窗口超出范围 有没有办法解决这个问题
  • 在 Django 中,如何调用“用户组”作为模型类中的外键?

    我创建了一个名为 Question 的模型类 我希望只有特定的用户组才能回答问题 现在 我如何从用户组中引入外键 在我的数据库中有一个问题表 会有很多问题 但并非所有用户都可以查看或回答问题 这将取决于用户属于哪个用户组 所以我必须指定允许
  • 如何挂载 kubernetes.io/dockerconfigjson

    我有一个类型的秘密kubernetes io dockerconfigjson kubectl describe secrets dockerjson Name dockerjson Namespace my prd Labels
  • div 中的图像水平居中[重复]

    这个问题在这里已经有答案了 我有一个img在 div class top image 并且我希望这个图像正好位于 div 的中间 但我尝试的任何方法都不起作用 谢谢你的帮助 此处发布的每个解决方案都假设您知道您的尺寸img 这不是常见的情况
  • 将 Webhook 用于 Microsoft Graph API 的问题

    我使用 Graph API 为群组对话添加网络挂钩 因为我需要监视所有组的对话 所以我读取了组列表并为每个组添加了网络挂钩 20 30组后 不同账户的数量会有所不同 Graph API开始返回错误 error code message Se
  • SurfaceTexture.getTransformMatrix的返回值是什么意思,谁能解释一下?

    每个人 我正在Android中使用SurfaceTexture 但我无法理解它的API getTransformMatrix float mtx API文档如下 Retrieve the 4x4 texture coordinate tra
  • 目标构建失败后 CMake 运行自定义命令

    我知道如何在使用 add custom command 构建目标之后 或之前 运行命令 add custom command TARGET my target POST BUILD COMMAND echo custom command 但
  • Apache RewriteRule 到子目录

    我需要将 myhomepage com 重定向到 myhomepage com sub 当我阅读 apache org docs 1 3 misc rewriteguide html 上的指南时 我不知道他们在说什么 因此我决定友好地询问这
  • 在 WPF WebBrowser 控件中显示字符串中的 html

    我的数据上下文对象包含一个字符串属性 该属性返回我需要在 WebBrowser 控件中显示的 html 我找不到可将其绑定到的 WebBrowser 的任何属性 有任何想法吗 Thanks The WebBrowser has a 导航至字
  • 有效的 XPath 表达式

    只是两个问题 如何检查分配给变量的字符串是否对应于有效的 XPath 表达式 如果请求的资源不存在 如何返回自定义的错误消息 如果 XPath 无效 您将收到异常 如果请求的节点不存在 您将得到空结果 放 例如 from lxml impo
  • 如何设置 MPNowPlayingInfoCenter 的图稿图像

    我一直在尝试更新以下项目中显示的艺术品MPNowPlayingInfoCenter using MPMediaItemPropertyArtwork如以下代码所示 取自苹果的文档 https developer apple com docu
  • MySQL week() 函数以星期六开始

    在 MySQL 中 是否有可能或者如何修改 week 以便一周从星期六开始 我在用WEEK CURDATE 0 获取开始日期为星期日的周数 但是 我想获取起始日为星期六的周数 我想我找到了一种方法 只需将日期移 1 天即可 WEEK CUR
  • jQuery-mobile 1.3 面板始终可见

    在新的 jQuery mobile 1 3 版本中 如何添加一个从一开始就始终可见的左侧面板 该面板将充当导航菜单 Thanks 您可以像这样以编程方式打开它 document on pagebeforeshow index functio
  • 无法更改 Unity 中 Inspector 变量中的数组大小?

    根据我读到的内容 这就是矢量 大小 的设置方式 public Color teamAColors new Color 4 But when the code is run it looks like this 我为 4 设置的数字似乎并不重
  • 为什么 Rails 命令强制显示“new”命令的帮助消息?

    奇怪的是 在某些情况下我无法执行典型的 Rails 命令 例如rails s and rails c 我发现这种情况发生在某个功能分支上 过去也偶尔发生过 但目前适用于我的develop branch 我逆转了任何 rb可以加载并产生任何效