2011-04-28 79 views
2

当我尝试生成安装了Rails 3.0.6或3.0.7的新应用程序时,我刚刚获得了使用rails命令的说明。出于某种原因,Rails似乎认为我输入了错误的语法(当然,我没有)。不过,一切正常,在3.0.5或更低。我运行Ruby 1.9.2和Ubuntu 10.04。无法使用Rails 3.0.6或3.0.7生成新应用程序

rails new app

会导致:

Usage: 
    rails new APP_PATH [options] 

Options: 
    -r, [--ruby=PATH]   # Path to the Ruby binary of your choice 
           # Default: /usr/local/bin/ruby 
    -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. 
+0

听起来像他们已经使应用程序保留字,并没有失败优雅。 Rails确实创建了一个应用程序目录,可能已经添加了一些东西来避免从应用程序中存在的目录中命名应用程序,尝试类似“rails new config”的内容并查看它是否失败 – 2011-04-28 18:12:58

+0

“应用程序”只是一个例。 “rails new my_app”同样失败。 – user544941 2011-04-28 18:15:57

+0

“rails新应用程序”对我来说工作正常。 Rails 3.0.6,Ubuntu 11.04。 – PreciousBodilyFluids 2011-04-28 18:22:46

回答

3

尝试更新RubyGems的;

$ gem update --system 
+0

这实际上解决了我的问题。奇怪的。谢谢! – user544941 2011-04-30 14:04:10

+0

对我来说,非常感谢! – Mobbit 2011-05-01 16:05:58

0

似乎运行rvm rubygems current打破了这种,至少对我来说。 我运行命令,因为它提到here它将摆脱所有的弃用警告,运行gem update --system修复它,并带回弃用警告。

相关问题