gpt4 book ai didi

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

转载 作者:数据小太阳 更新时间:2023-10-29 07:29:14 26 4
gpt4 key购买 nike

当我输入时:

$ rails server

我得到这个返回并输入 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

所以在我的应用程序文件夹中,我切换到使用的适当的 gemset。

rvm gemset use [your gemset name]

然后

bundle install

更新 gem 文件。

之后一切正常。

关于ruby-on-rails - 在终端中输入 Rails 命令,返回帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8371629/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com