Rails 为什么我还是无法启动 ROR

beasthang · 2011年12月02日 · 最后由 _samqiu 回复于 2012年02月04日 · 4445 次阅读

gem 安装如下: *** LOCAL GEMS ***

actionmailer (3.1.3) actionpack (3.1.3) activemodel (3.1.3) activerecord (3.1.3) activeresource (3.1.3) activesupport (3.1.3) arel (2.2.1) builder (3.0.0) bundler (1.0.21 ruby) capistrano (2.9.0) cgi_multipart_eof_fix (2.5.0) daemons (1.1.4) erubis (2.7.0) fastthread (1.0.7) gem_plugin (0.2.3) highline (1.6.8) hike (1.2.1) i18n (0.6.0) json (1.6.2) mail (2.3.0) mime-types (1.17.2) multi_json (1.0.4) net-scp (1.0.4) net-sftp (2.0.5) net-ssh (2.2.1) net-ssh-gateway (1.1.0) polyglot (0.3.3) rack (1.3.5) rack-cache (1.1) rack-mount (0.8.3) rack-ssl (1.3.2) rack-test (0.6.1) rails (3.1.3) railties (3.1.3) rake (0.9.2.2, 0.9.2) rdoc (3.11) rubygems-update (1.8.11) sprockets (2.0.3) thor (0.14.6) tilt (1.3.3) treetop (1.4.10) tzinfo (0.3.31)

可是一启动就出现如下问题: Usage: rails new APP_PATH [options]

Options: -r, [--ruby=PATH] # Path to the Ruby binary of your choice # Default: /home/beasthang/.rvm/rubies/ruby-1.9.2-p290/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] # Supress 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.

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. beasthang@beasthang-Thinkpad:~/demo$ rails demo1 Usage: rails new APP_PATH [options]

Options: -r, [--ruby=PATH] # Path to the Ruby binary of your choice # Default: /home/beasthang/.rvm/rubies/ruby-1.9.2-p290/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] # Supress 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.

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. beasthang@beasthang-Thinkpad:~/demo$ gem install rdoc Depending on your version of ruby, you may need to install ruby rdoc/ri data:

菜鸟的楼主求助啊。

环境应该配置的差不多了。一新建就不行啊。给菜鸟指点下吧。

匿名 #2 2011年12月02日
rails new appname

你是这样建里的么?

还是 ··· rails appname ···

@KennX 是 rails appname 应该没错的吧

匿名 #4 2011年12月02日

#3 楼 @beasthang 当然是错的 rails new app

@KennX 汗,尝试了下,果然可以。= =!跟书上的不一样了?1.9.2 版本有变化了?

匿名 #6 2011年12月02日

#5 楼 @beasthang 你看的什么书。我汗。。。ruby script/server 改成了 rails server

@KennX web 开发敏捷之道。刚才尝试了下启动服务器。好像也不行啊。用 rails server 也无法启动啊。rails s 也不行。

@KennX 忘说了。是第三版的。汗。伤不起啊。又变化。

匿名 #9 2011年12月02日

cd appname rails server

要进入你的应用程序的文件夹。。。

web 敏捷开发(第 3 版)??? 现在提前告诉你数据库的事情 rails new appname -d mysql

@KennX 呃,要崩溃了。看来必须装的版本跟书上一样才行了。

#10 楼 @beasthang 早八辈子都第四版了

匿名 #12 2011年12月02日

#10 楼 @beasthang 没关系,你继续看。他是市场上可以买到最好的一本入门书。即便是版本旧。 我当时也是 ruby 1.9.2 ,rails 3.1.3 开始对着这书折腾的。算是基本了解了 rails 和 ruby。

@clc3123我知道第四版出来了。可是没有中译版啊。就入了第三版了。 @KennX 恩,我安装书上的版本去。

@KennX 为什么我启动了服务器以后。http://localhost:3000/还是无法打开该页面呢?

匿名 #15 2011年12月02日

木有关系,先按书上的版本照着来。

Rails 在快速成长,版本变化比较大,有人专门写了博文讲这个问题,后来推到 Hacker News 上。新手刚学的时候可能会感叹 Rails 好是好,但是更新得太快,学都学不来。

不管楼主英文水平如何,如果想入门的话官方的 Guides 还是非常有必要看的。

#14 楼 @beasthang 浏览器提示什么?控制台又提示什么?要学会看 Log

需要 登录 后方可回复, 如果你还没有账号请 注册新账号