如何使用rails>创建新的rails应用程序? 3.0.3?

时间:2011-05-17 17:35:52

标签: ruby-on-rails-3 new-operator

创建新应用程序时,我遇到3.0.3之后的任何rails版本的问题,我希望你的意见。

首先,我从系统gem uninstall rails中移除导轨并按照说明正确操作。然后我安装了最新版本的rails gem install rails,一切顺利,我的系统上有rails 3.0.7。

当我尝试创建一个新应用时,我得到的是:

Usage:
  rails new APP_PATH [options]

Options:
  -J, [--skip-prototype]      # Skip Prototype files
  -T, [--skip-test-unit]      # Skip Test::Unit files
  -G, [--skip-git]            # Skip Git ignores and keeps
  -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
  -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
      [--skip-gemfile]        # Don't create a Gemfile
  -d, [--database=DATABASE]   # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db)
                              # Default: sqlite3
  -r, [--ruby=PATH]           # Path to the Ruby binary of your choice
                              # Default: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  -O, [--skip-active-record]  # Skip Active Record files

Runtime options:
  -q, [--quiet]    # Supress status output
  -s, [--skip]     # Skip files that already exist
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes

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.

无法创建骨架,我不断获取该菜单。

如果我删除3.0.7并切换回3.0.3然后一切都很好,我确实得到了一个应用程序框架。如果我尝试3.0.4,同样的问题。

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

因为你们中的一些人证实了rails>完全没有问题。 3.0.3我通过运行来清理我的配置:

sudo gem clean

根据我的理解,它删除了系统中所有旧版本的宝石,因此我最终使用rails 3.0.7,现在我已成功创建新应用程序了!我可以回到我的项目,谢谢你的帮助:)。