14

私はルビーとレールが初めてで、レールをubuntuにインストールしました。しかし、「rails s」と入力して開始サーバーに移動すると、開始されず、次のメッセージが表示されます。しかし、コマンド rails new new_project で新しいプロジェクトを作成できます。Railsのスペシャリストが私を助けてください。

root@ubuntu:~# rails s Usage: rails new APP_PATH [options] Options: -j, [--javascript=JAVASCRIPT] 
# Preconfigure for selected JavaScript library # Default: jquery -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 -J, [--skip-javascript] # Skip JavaScript files [--edge] 
# Setup the application with Gemfile pointing to Rails repository -G, [--skip-git] 
# Skip Git ignores and keeps -d, [--database=DATABASE] 
# Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc) 
# Default: sqlite3 -b, [--builder=BUILDER] 
# Path to a application builder (can be a filesystem path or URL) -r, [--ruby=PATH] 
# Path to the Ruby binary of your choice 
# Default: /usr/bin/ruby1.8 [--old-style-hash] 
# Force using old style hash (:foo => 'bar') on Ruby >= 1.9 [--skip-gemfile] 
# Don't create a Gemfile -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 Runtime options: -q, [--quiet] 
# Supress status output -f, [--force] 
# Overwrite files that already exist -s, [--skip] 
# Skip files that already exist -p, [--pretend] 
# Run but do not make any changes 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
4

6 に答える 6

11
  1. 新しい Rails アプリを作成する必要があります (まだ作成していない場合)。

    rails new my_app
    
  2. アプリのディレクトリに移動します

    cd my_app
    
  3. そのディレクトリでサーバーを起動します

    rails s
    
于 2012-04-07T12:25:04.613 に答える
5

プロジェクトを作成し、それにcd'd したら:

Rails バージョン 2.x を使用script/serverしている場合に使用します

Rails バージョン 3.x を使用script/rails serverしている場合に使用します

Rails バージョン 4.x を使用bin/rails serverしている場合に使用します

于 2012-04-07T12:24:23.047 に答える
1

Railsサーバーを起動する前に、アプリケーションのディレクトリにcdする必要があります。これは、サーバーがサービスを提供することになっているアプリケーションを知る必要があるためです。

于 2013-01-27T21:05:02.463 に答える