gpt4 book ai didi

ruby-on-rails - rails server 只打印命令用法

转载 作者:行者123 更新时间:2023-12-05 01:06:48 24 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





Rails server does not start by command "Rails s"

(6 个回答)


8年前关闭。



$ rails server

Usage: rails new APP_PATH [options]

Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /home/bikram/.rvm/rubies/ruby-1.9.3-p448/bin/ruby

-b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL)
-m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
[--skip-gemfile] # Don't create a Gemfile
[--skip-bundle] # Don't run bundle install
-G, [--skip-git] # Skip Git ignores and keeps
-O, [--skip-active-record] # Skip Active Record files
-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] # Suppress 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.

You can specify extra command-line arguments to be used every time
'rails new' runs in the .railsrc configuration file in your home directory.

Note that the arguments specified in the .railsrc file don't affect the
defaults values shown above in this help message.

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 本地服务器。其他版本有:
  • rails 3.2.14
  • ruby 1.9.3p448 (2013-06-27 修订版 41675) [i686-linux]
  • gem 2.1.9
  • rvm 1.23.9(稳定)

  • 我的 gem 文件是:
    source 'https://rubygems.org'

    gem 'rails', '3.2.14'

    group :development, :test do
    gem 'sqlite3', '1.3.5'
    gem 'rspec-rails', '2.11.0'
    end

    # Gems used only for assets and not required
    # in production environments by default.
    group :assets do
    gem 'sass-rails', '3.2.5'
    gem 'coffee-rails', '3.2.2'
    gem 'uglifier', '1.2.3'
    end

    gem 'jquery-rails', '2.0.2'

    group :test do
    gem 'capybara', '1.1.2'
    end

    group :production do
    gem 'pg', '0.12.2'
    end

    最佳答案

    这是当您尝试在没有 Rails 应用程序的文件夹中启动 Rails 服务器时生成的默认消息。

    您需要运行 rails new <appname>其中 appname 是您在启动服务器之前所在的文件夹。

    如果它是一个 Rails 应用程序,那么您可能会遗漏服务器命令用来确定它是否是一个 Rails 应用程序的一些关键文件。

    关于ruby-on-rails - rails server 只打印命令用法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19467254/

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