gpt4 book ai didi

ruby-on-rails - 命令 : rails console, 生成无法识别。错误:无法识别命令 'rails' 用法:rails COMMAND [ARGS]

转载 作者:可可西里 更新时间:2023-11-01 09:47:26 25 4
gpt4 key购买 nike

当我转到 rails 文件夹(我在我的 rails app 文件夹中)并输入“rails c”或“rails g”时,它说:

错误:无法识别命令“rails”

用法:rails COMMAND [ARGS]

Usage: spring COMMAND [ARGS]                                                                                                                     

Commands for spring itself:

binstub Generate spring based binstubs. Use --all to generate a binstub for all known commands. Use --remove to revert.
help Print available commands.
server Explicitly start a Spring server in the foreground
status Show current status.
stop Stop all spring processes for this project.

Commands for your application:

rails Run a rails command. The following sub commands will use spring: console, runner, generate, destroy, test.
rake Runs the rake command
Error: Command 'rails' not recognized
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:
destroy Undo code generated with "generate" (short-cut alias: "d")
plugin new Generates skeleton for developing a Rails 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.

我正在运行适用于 Windows 10 的 Linux 子系统,我知道我知道你看到的是 Windows,但它有点……Linux,我通过 rbenv 通过 this tutorial 安装了 Ruby .

最佳答案

从您的应用程序文件夹中尝试此命令:

rake rails:update:bin

说 y 替换二进制文件。

我在将 Rails 与 Windows Linux 子系统一起使用时遇到了同样的问题。我在这里找到了建议:

Rails command Error

我试过了,它解决了我的问题,也许你的问题也是如此。

关于ruby-on-rails - 命令 : rails console, 生成无法识别。错误:无法识别命令 'rails' 用法:rails COMMAND [ARGS],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38909744/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com