加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 在终端输入Rails命令,返回帮助

发布时间:2020-12-17 03:01:45 所属栏目:百科 来源:网络整理
导读:当我进入: $rails server 我得到这个返回for和rails命令输入: Usage: rails new APP_PATH [options]Options: [--edge] # Setup the application with Gemfile pointing to Rails repository [--dev] # Setup the application with Gemfile pointing to you
当我进入:

$rails server

我得到这个返回for和rails命令输入:

Usage:
  rails new APP_PATH [options]

Options:
  [--edge]                   # Setup the application with Gemfile pointing to Rails repository
  [--dev]                    # Setup the application with Gemfile pointing to your Rails checkout
  -G,[--skip-git]               # Skip Git ignores and keeps
  -m,[--template=TEMPLATE]      # Path to an application template (can be a filesystem path or URL)
  -b,[--builder=BUILDER]        # Path to a application builder (can be a filesystem path or URL)
      [--old-style-hash]         # Force using old style hash (:foo => 'bar') on Ruby >= 1.9
      [--skip-gemfile]           # Don't create a Gemfile
  -d,[--database=DATABASE]      # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                 # Default: sqlite3
  -O,[--skip-active-record]     # Skip Active Record files
      [--skip-bundle]            # Don't run bundle install
  -T,[--skip-test-unit]         # Skip Test::Unit files
  -S,[--skip-sprockets]         # Skip Sprockets files
  -j,[--javascript=JAVASCRIPT]  # Preconfigure for selected JavaScript library
                                 # Default: jquery
  -J,[--skip-javascript]        # Skip JavaScript files
  -r,[--ruby=PATH]              # Path to the Ruby binary of your choice
                                 # Default: /usr/bin/ruby1.8

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

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.

为什么不启动服务器?对我来说,这似乎是一个rails helpDoc或其他一些.
类似的情况也发生在:

$rails generate

有什么办法可以让这些命令正确启动……

我在Ubuntu上使用Rails 3.1.3版.

顺便说一句:我是从myapp目录中输入的,即

chuckles@.......:~/Blog/new$

我确实通过运行来启动服务器:

$script/server

来自/新/

解决方法

我有这个问题.事实证明我创建了一个与我的应用程序一起使用的gemset,然后当我切换到终端中的app文件夹时,它恢复到不支持我的应用程序的默认gemset.

您可以通过执行操作来检查您使用的gemset

rvm gemset list

因此,在我的app文件夹中,我使用了切换到相应的gemset.

rvm gemset use [your gemset name]

然后

bundle install

更新gem文件.

事后一切都很好.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读