2011-01-09 83 views
5

背景信息时:错误//用法:轨道新APP_PATH [选项] //运行“轨道的服务器”

我使用GIT获得与它的Ruby文件的项目的存储库。该项目位于我的Mac主目录下的SITES文件夹中。

我有红宝石:1.8.7

我刚刚升级的Rails:3.0.3

所有我想做到的是要能够使localhost.com:3000在我的浏览器我已经下载了GIT项目,所以我可以在本地工作。

我跑命令“轨服务器”,并返回你从错误的目录中运行以下rails server ::

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. 

回答

11

消息。进入包含你的应用程序的目录并从那里运行命令。例如,如果您运行的是rails new thingy,则在使用rails server时,您必须位于thingy目录中。

+0

我得到相同的错误,我也在正确的目录中。其他任何可能导致这种情况的东西? – Ava 2011-10-19 20:56:45

7

我从rails 2升级到rails 3时也得到了这个。然后我运行rails new .来替换所有必需的文件,并在此之后运行。