错误//用法:rails new APP_PATH [options]//运行“rails server"时 [英] Error // Usage: rails new APP_PATH [options] // when running 'rails server'

查看:70
本文介绍了错误//用法:rails new APP_PATH [options]//运行“rails server"时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景信息:

我正在使用 GIT 获取包含 Ruby 文件的项目的存储库.该项目位于 Mac 主目录下的 SITES 文件夹中.

I'm using GIT to get a repository of a project with Ruby files in it. The project lives in my SITES folder under home directory on my Mac.

我有 Ruby:1.8.7

I have Ruby: 1.8.7

我刚刚将 Rails 升级到:3.0.3

I have just upgraded Rails to: 3.0.3

我想要完成的只是能够在我已经下载的 GIT 项目的浏览器中呈现 localhost.com:3000,以便我可以在本地进行处理.

All I am trying to accomplish is to be able to render localhost.com:3000 in my browser of the GIT project I've already downloaded so I can work on it locally.

我运行了rails server"命令并返回了以下消息::

I ran the command 'rails server' and was returned the message below::

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-gemfile]        # Don't create a Gemfile
  -m, [--template=TEMPLATE]   # Path to an application template (can be a filesystem path or URL)
  -d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)
                              # Default: sqlite3
  -O, [--skip-active-record]  # Skip Active Record files
  -J, [--skip-prototype]      # Skip Prototype files
  -T, [--skip-test-unit]      # Skip Test::Unit files
      [--dev]                 # Setup the application with Gemfile pointing to your Rails checkout
  -r, [--ruby=PATH]           # Path to the Ruby binary of your choice
                              # Default: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  -G, [--skip-git]            # Skip Git ignores and keeps
  -b, [--builder=BUILDER]     # Path to an application builder (can be a filesystem path or URL)
      [--edge]                # Setup the application with Gemfile pointing to Rails repository

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

Rails options:
  -h, [--help]     # Show this help message and quit
  -v, [--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.

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 server.进入包含您的应用程序的目录并从那里运行命令.例如,如果你运行了rails new thingy,你在使用rails server时必须在thingy目录下.

You're running rails server from the wrong directory. Go INTO the directory containing your app and run the command from there. For example, if you ran rails new thingy, you must be in the thingy directory when you use rails server.

这篇关于错误//用法:rails new APP_PATH [options]//运行“rails server"时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆