错误//用法:rails new APP_PATH //运行’rails server’时

背景资料:

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

我有Ruby:1.8.7

我刚刚将Rails升级到:3.0.3

我想要完成的就是能够在我已经下载的GIT项目的浏览器中呈现localhost.com:3000,这样我就可以在本地工作了。

我运行命令’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. 

您正在从错误的目录运行rails server 。 转到包含您的应用程序的目录并从那里运行命令。 例如,如果您运行rails new thingy ,则在使用rails server时必须位于thingy目录中。

从轨道2升级到轨道3时我也得到了这个。 然后我跑了rails new . 替换所有必要的文件,然后它工作。