-1

我刚刚安装了http://rubyinstaller.org/中的 Ruby on Rails 包(这是我第一次尝试在我的 xp sp3 系统中设置 ruby​​ on rails 工作站。)。安装过程很顺利,没有任何错误。我使用它的控制台启动了服务器。服务器已启动,但http://localhost:3000显示错误页面(未找到页面)。我在控制台中有以下显示。我错过了什么吗?

#Rails Environment Configuration.

---
git:
  user.name:  XYZ
  user.email: xyzuser
  version:    git version 1.8.1.msysgit.1

ruby:
  bin:        C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe
  version:    ruby 1.9.3p392 (2013-02-22) [i386-mingw32]

rails:
  bin:        C:/RailsInstaller/Ruby1.9.3/bin/rails.bat
  version:    Rails 3.2.13

ssh:
  public_key_location: C:\Documents and Settings\xyz/.ssh/id_rsa.pub
  public_key_contents: ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArYKMRvMHxKJ2R//5viqQp
D4IQhVcKZhhbfvZGzDOXF1M//pewAQDK2x9y8T8irvatgmDMCYB5L2uZiyXwG3gPm6Bfw44mCHhNP8xN
bT2OSDnvIoZcFVfmQExZmwWcSNqm0NionObUV+IFKvfjg9bOPl4GBUqSXSTlUmAn/wQq0c/m+GoJwDlI
dV/h69dq4tHYwpCMFUZ9k4LqR4VICktV5Fi1VQA14u4Y9kOWAAyAfzeXnOzcpkbYxgjbCvAf20gM6lSL
9NvNsLuzI5yLxhI5wAmZbK+11zgNmx019tbv1uHvZRV2Z53aWpErtuvipAieQ977U4kYQPMyFf8g8BKd
Q== XYZ<xyzuser>




C:\Sites>

服务器启动时的控制台输出为:

C:\Sites>rails s
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
                                 # Default: C:/RailsInstaller/Ruby1.9.3/bin/ruby
.exe
  -b, [--builder=BUILDER]        # Path to a application builder (can be a files
ystem path or URL)
  -m, [--template=TEMPLATE]      # Path to an application template (can be a fil
esystem 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 t
o your Rails checkout
      [--edge]                   # Setup the application with Gemfile pointing t
o 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.

C:\Sites>
4

4 回答 4

1

谢谢大家。最后我得到了它的工作。问题是我的test_app文件夹中的Gemfile。我评论了gem 'uglifier', '>= 1.0.3'行,我得到了它的工作。希望它也能进一步发挥作用,让我继续前进。

于 2013-07-22T11:49:39.733 回答
0

首先,您必须创建一个新的 rails 项目。我认为 C:/Sites 不是您的 rails 项目目录。

rails new test_app

它将在您的目录中创建一个 rails 项目。比去 cd test_app. 并尝试启动您的服务器。希望它会奏效。

于 2013-07-22T11:24:13.220 回答
0

您必须cd在创建的 rails 项目的目录中,然后rails s应该可以正常工作。

这也意味着服务器尚未启动。请仔细阅读控制台命令的输出,大多数情况下它们会告诉您它们在做什么,或者为什么它们不能按预期工作。

于 2013-07-22T11:20:46.047 回答
0

服务器未启动。您需要导航到您的 rails 应用程序文件夹,安装所需的 gem 并启动服务器:

cd <your app folder>
bundle install
rails s
于 2013-07-22T11:22:30.260 回答