在启动新的铁路博客时覆盖提示

时间:2012-06-06 23:26:52

标签: ruby-on-rails

当我进入

    rails new blog

它返回

    exist  
       identical  README.rdoc
       identical  Rakefile
       identical  config.ru
       identical  .gitignore
       identical  Gemfile
           exist  app
       identical  app/assets/images/rails.png
       identical  app/assets/javascripts/application.js
       identical  app/assets/stylesheets/application.css
       identical  app/controllers/application_controller.rb
       identical  app/helpers/application_helper.rb
           exist  app/mailers
           exist  app/models
       identical  app/views/layouts/application.html.erb
       identical  app/mailers/.gitkeep
       identical  app/models/.gitkeep
           exist  config
       identical  config/routes.rb
       identical  config/application.rb
       identical  config/environment.rb
           exist  config/environments
       identical  config/environments/development.rb
       identical  config/environments/production.rb
       identical  config/environments/test.rb
           exist  config/initializers
       identical  config/initializers/backtrace_silencers.rb
       identical  config/initializers/inflections.rb
       identical  config/initializers/mime_types.rb
        conflict  config/initializers/secret_token.rb
    Overwrite /Users/user/blog/config/initializers/secret_token.rb? (enter "h" for help)    [Ynaqdh] 

我是否按y / yes或n / no安装捆绑包和

    cd blog

命令通过 - 但是当我尝试

    rails server

我得到了

    [2012-06-06 19:21:59] WARN  Could not determine content-length of response body. Set     content-length of the response or set Response#chunked = true

[2012-06-06 19:22:00]警告无法确定响应正文的内容长度。设置响应的内容长度或设置Response#chunked = true

我发现你应该在哪里安装“瘦”gemfile来解决这个问题,并运行

    rails server thin

然后返回

    /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `require': cannot load such file -- thin (LoadError)
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler/thin.rb:1:in `<top (required)>'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler.rb:20:in `const_get'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler.rb:20:in `block in get'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler.rb:20:in `each'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler.rb:20:in `inject'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/handler.rb:20:in `get'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:269:in `server'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/commands/server.rb:59:in `start'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/commands.rb:50:in `tap'
from /Users/user/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

但是“localhost:3000”会显示一个Oops页面,说它无法找到该页面,但是当我输入常规服务器命令时,该页面完好无损,但警告阻止我继续前进。

任何想法?

谢谢Dty-注意n00bs,你需要在不同的窗口中运行服务器和代码(我现在觉得很慢)

1 个答案:

答案 0 :(得分:0)

使用rails server时看到的警告是正常的。请注意,他们只是警告所以不应该阻止您继续前进。

如果您使用瘦服务器,则正确的命令应为thin start。如果您使用的是rails 3.2rc2,那么according to thisrails server将在您gem 'thin' Gemfile中使用{{1}}。