0

已安装: - Windows 7 64 位 - Ruby200-x64 - Rails (4.0.0) - ruby​​gems-update (2.0.3) - mysql2(0.3.11) - mysql-installer-community-5.6.12.1

在创建一个名为 simple_cms 的新 rails 应用程序后,尝试使用命令运行 Webrick:rerails s:(请参阅下面的命令)

任何有关配置的帮助将不胜感激。不知道我哪里错了....请帮忙!

C:\Users\User\My Documents\sites\simple_cms>rails s

Usage:
rails new APP_PATH [options]

Options:
-r, [--ruby=PATH]              # Path to the Ruby binary of your choice
                             # Default: C:/Ruby200-x64/bin/ruby.exe
-m, [--template=TEMPLATE]      # Path to some application template (can be a f
ilesystem path or URL)
  [--skip-gemfile]           # Don't create a Gemfile
-B, [--skip-bundle]            # Don't run bundle install
-G, [--skip-git]               # Skip .gitignore file
  [--skip-keeps]             # Skip source control .keep files
-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 to Rails    repository
-T, [--skip-test-unit]         # Skip Test::Unit files
  [--rc=RC]                  # Path to file containing extra configuration options for rails command
  [--no-rc]                  # Skip loading of extra configuration options f

ROM .railsrc 文件

运行时选项: -f, [--force] # 覆盖已经存在的文件 -p, [--pretend] # 运行但不做任何更改 -q, [--quiet] # 抑制状态输出 -s, [- -skip] # 跳过已经存在的文件

Rails options: -h, [--help] # 显示帮助信息并退出 -v, [--version] # 显示 Rails 版本号并退出

描述:“rails new”命令在您指定的路径创建一个具有默认目录结构和配置的新 Rails 应用程序。

 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.

示例: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."



gem list:

C:\Users\User\My Documents\sites\simple_cms>gem 列表

*当地宝石*

  • actionmailer (4.0.0)
  • 行动包 (4.0.0)
  • 活动模型(4.0.0)
  • 活动记录(4.0.0)
  • activerecord-deprecated_finders (1.0.3)
  • 主动支持 (4.0.0)
  • 雷尔 (4.0.0)
  • 原子(1.1.10)
  • 大十进制 (1.2.0)
  • 建设者(3.1.4)
  • 捆绑器 (1.3.5)
  • 咖啡轨(4.0.0)
  • 咖啡脚本(2.2.0)
  • 咖啡脚本源 (1.6.3)
  • 厄鲁比斯 (2.7.0)
  • 执行js (1.4.0)
  • 远足 (1.2.3)
  • i18n (0.6.4)
  • io 控制台 (0.4.2)
  • jbuilder (1.4.2)
  • jquery-rails (3.0.3, 3.0.2)
  • json (1.8.0, 1.7.7)
  • 邮件 (2.5.4)
  • 哑剧类型 (1.23)
  • 迷你测试(4.7.5、4.3.2)
  • multi_json (1.7.7)
  • mysql (2.9.1)
  • mysql2 (0.3.11)
  • 多语言(0.3.3)
  • 心理 (2.0.0)
  • 机架 (1.5.2)
  • 机架测试(0.6.2)
  • 导轨 (4.0.0)
  • 铁路(4.0.0)
  • 耙子 (10.1.0, 0.9.6)
  • rdoc (4.0.0, 3.12.2)
  • rubygems 更新 (2.0.3)
  • 萨斯(3.2.9)
  • sass-rails (4.0.0)
  • sdoc (0.3.20)
  • 链轮 (2.10.0)
  • 链轮导轨 (2.0.0)
  • 测试单元(2.0.0.0)
  • 雷神 (0.18.1)
  • 线程安全(0.1.0)
  • 倾斜 (1.4.1)
  • 树顶 (1.4.14)
  • 涡轮链接 (1.2.0)
  • tzinfo (0.3.37)
  • 丑化者 (2.1.1)

数据库.yml:

# MySQL.  Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
#   gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
#   gem 'mysql2'
#
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html

development:
adapter: mysql2
encoding: utf8
database: simple_cms_development
pool: 5
username: root
password: 
host: localhost

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.

test:
adapter: mysql2
encoding: utf8
database: simple_cms_test
pool: 5
username: root
password: 
host: localhost

production:
adapter: mysql2
encoding: utf8
database: simple_cms_production
pool: 5
username: root
password:
host: localhost
4

1 回答 1

0

如果你只想使用 Webrick,最简单的方法是在项目根目录中的 config.ru 文件上运行 Rack,Rails 默认包含在新应用程序中:

架起来

这应该会自动在 webrick 服务器上启动您的 rails 应用程序

于 2013-07-11T16:36:23.790 回答