2011-01-09 70 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 .來替換所有必需的文件,並在此之後運行。