'rails s'命令不起作用

问题描述 投票:-2回答:1

运行rails s显示以下错误。

$ rails s

Usage:
  rails new APP_PATH [options] 
Options:
  -r, [--ruby=PATH]           # Path to the Ruby binary of your choice
                              # Default: /usr/bin/ruby2.3
  -d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)
                              # Default: sqlite3
  -b, [--builder=BUILDER]     # Path to an application builder (can be a filesystem path or URL)
  -m, [--template=TEMPLATE]   # Path to an application template (can be a filesystem path or URL)
      [--dev]                 # Setup the application with Gemfile pointing to your Rails checkout
      [--edge]                # Setup the application with Gemfile pointing to Rails repository
      [--skip-gemfile]        # Don't create a Gemfile
  -O, [--skip-active-record]  # Skip Active Record files
  -T, [--skip-test-unit]      # Skip Test::Unit files
  -J, [--skip-prototype]      # Skip Prototype files
  -G, [--skip-git]            # Skip Git ignores and keeps
Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -q, [--quiet]    # Supress status output
  -s, [--skip]     # Skip files that already exist
Rails options:
  -v, [--version]  # Show Rails version number and quit
  -h, [--help]     # Show this help message and quit
Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.
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.

如何纠正这个问题?请提供有关此问题发生原因的一些想法。

ruby-on-rails
1个回答
1
投票

问题是你运行这个错误的目录,例如项目创建命令

rails new project_name

然后

cd project_name

然后运行bundle,rake和server

rails s 

要么

 rails server 
© www.soinside.com 2019 - 2024. All rights reserved.