2011-04-28 80 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修復它,並帶回棄用警告。

相關問題