【问题标题】:How can I generate a Model/Controller in Rails 3.1.1.rc1?如何在 Rails 3.1.1.rc1 中生成模型/控制器?
【发布时间】:2011-11-01 17:01:52
【问题描述】:

当我跑步时:

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.

WTF?

【问题讨论】:

    标签: ruby-on-rails controller generator


    【解决方案1】:

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

    【讨论】:

    • 是的,我正在从我的 Rails APP 根文件夹运行。
    • 根目录是否以任何方式损坏? “ls”/“dir”的输出是什么?
    猜你喜欢
    • 2015-02-05
    • 1970-01-01
    • 2019-12-17
    • 2012-12-25
    • 2016-11-12
    • 1970-01-01
    • 1970-01-01
    • 2016-05-22
    • 2016-06-23
    相关资源
    最近更新 更多