部署 部署问题请教

1272729223 · 2013年03月15日 · 最后由 1272729223 回复于 2013年03月15日 · 2682 次阅读

我在参考 wiki 上面的教程和 rei 还有自己 google 昨天弄了整整一天,就是不能访问我的 rails application 啊。

现在我只能做到:www.darkedog.com

我用的 mongodb,但是不知道config/mongoid.yml如何配置,还有其他什么问题引起的?

看 log/production.log,什么错误

/opt/nginx/logs/error.log*

2013/03/14 22:38:51 [error] 17086#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 115.195.168.193, server: darkedog.com, request: "GET / HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "darkedog.com"
[ pid=17099 thr=69414950 file=utils.rb:176 time=2013-03-14 22:38:51.309 ]: *** Exception Mongoid::Errors::NoSessionsConfig in application (
Problem:
  No sessions configuration provided.
Summary:
  Mongoid's configuration requires that you provide details about each session that can be connected to, and requires in the sessions config at least 1 default session to exist.
Resolution:
  Double check your mongoid.yml to make sure that you have a top-level sessions key with at least 1 default session configuration for it. You can regenerate a new mongoid.yml for assistance via `rails g mongoid:config`.

 Example:
   development:
     sessions:
       default:
         database: mongoid_dev
         hosts:
           - localhost:27017

) (process 17099, thread #<Thread:0x846604c>):
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid/sessions/factory.rb:61:in `create_session'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid/sessions/factory.rb:43:in `default'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid/sessions.rb:109:in `default'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid.rb:129:in `default_session'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/mongoid-3.1.2/lib/mongoid/railtie.rb:149:in `block (3 levels) in <class:Railtie>'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/public_api.rb:40:in `call'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/public_api.rb:40:in `block in call_event'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/public_api.rb:39:in `each'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/public_api.rb:39:in `call_event'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb:399:in `before_handling_requests'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:205:in `start_request_handler'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:171:in `block in handle_spawn_application'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/utils.rb:470:in `safe_fork'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:166:in `handle_spawn_application'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:180:in `start'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb:129:in `start'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rack_application'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:246:in `block in spawn_rack_application'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'
    from <internal:prelude>:10:in `synchronize'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:244:in `spawn_rack_application'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
    from /home/yuwen/.rvm/gems/ruby-1.9.3-p392/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server:99:in `<main>'

/home/yuwen/darkedog/log/production.log

Started GET "/" for 115.195.168.193 at 2013-03-14 22:35:32 -0400
Processing by WelcomeController#index as HTML
  Rendered welcome/index.html.slim within layouts/application (0.7ms)
Completed 500 Internal Server Error in 1ms

ActionView::Template::Error (logo.png isn't precompiled):
    1: = image_tag("logo.png", :class => "logo")
    2: h1.hero =("2013移动互联网")
  app/views/welcome/index.html.slim:1:in `_app_views_welcome_index_html_slim__867937906_86812840'


Started GET "/" for 115.195.168.193 at 2013-03-14 22:35:32 -0400
Processing by WelcomeController#index as HTML
  Rendered welcome/index.html.slim within layouts/application (0.7ms)
Completed 500 Internal Server Error in 1ms

ActionView::Template::Error (logo.png isn't precompiled):
    1: = image_tag("logo.png", :class => "logo")
    2: h1.hero =("2013移动互联网")
  app/views/welcome/index.html.slim:1:in `_app_views_welcome_index_html_slim__867937906_86812840'


Started GET "/" for 115.195.168.193 at 2013-03-14 22:36:05 -0400
Processing by WelcomeController#index as HTML
  Rendered welcome/index.html.slim within layouts/application (48.4ms)
Completed 500 Internal Server Error in 89ms

ActionView::Template::Error (logo.png isn't precompiled):
    1: = image_tag("logo.png", :class => "logo")
    2: h1.hero =("2013移动互联网.")
  app/views/welcome/index.html.slim:1:in `_app_views_welcome_index_html_slim___380704576_79359030'

我用rails g mongoid:config生成的config/mongoid.yml没有默认的生产环境配置。

ActionView::Template::Error (logo.png isn't precompiled):

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