2011-11-01 33 views
0

当我运行:如何在Rails 3.1.1.rc1中生成模型/控制器?

rails generate model MyUsers 

我得到

-S, [--skip-sprockets]   # Skip Sprockets files 
    -d, [--database=DATABASE]  # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc) 
           # Default: sqlite3 
    -j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library 
           # Default: jquery 
    -J, [--skip-javascript]  # Skip JavaScript files 
     [--dev]     # Setup the application with Gemfile pointing to your Rails checkout 
     [--edge]     # Setup the application with Gemfile pointing to Rails repository 
    -T, [--skip-test-unit]   # Skip Test::Unit files 
     [--old-style-hash]   # Force using old style hash (:foo => 'bar') on Ruby >= 1.9 

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: 
    -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. 

跆拳道?

回答

1

你从哪里运行命令?它在Rails应用程序的根目录中吗?

+0

是的,我从我的Rails APP根文件夹运行。 – AndrewShmig

+0

以任何方式损坏根目录? “ls”/“dir”的输出是什么? – grifaton

+0

解决与:sudo gem clear – AndrewShmig