服务器为阿里云的 ubuntu 服务器 ~
环境如下:
Rails 5.1.1
ruby 2.4.1
ubuntu 14.04
Postgresql 9.3
Passenger 5.1.6
nginx 配置如下:
server {
listen 80;
server_name 域名;
root /home/homeland/public;
index index.html index.htm;
passenger_enabled on;
}
production.log 报错信息如下:
F, [2017-07-21T21:50:02.176570 #2842] FATAL -- :
F, [2017-07-21T21:50:02.176598 #2842] FATAL -- : app/controllers/application_controller.rb:73:in `block (2 levels) in render_optional_error_file'
app/controllers/application_controller.rb:71:in `render_optional_error_file'
app/controllers/application_controller.rb:60:in `render_404'
app/controllers/home_controller.rb:7:in `uploads'
I, [2017-07-21T21:50:02.177873 #2842] INFO -- : Started GET "/uploads/user/avatar/1/88363d.jpg!sm" for 171.216.71.44 at 2017-07-21 21:50:02 +0800
I, [2017-07-21T21:50:02.179074 #2842] INFO -- : Processing by HomeController#uploads as
I, [2017-07-21T21:50:02.179145 #2842] INFO -- : Parameters: {"path"=>"user/avatar/1/88363d"}
I, [2017-07-21T21:50:02.183168 #2842] INFO -- : Completed 500 Internal Server Error in 4ms (ActiveRecord: 0.3ms)
F, [2017-07-21T21:50:02.183918 #2842] FATAL -- :
F, [2017-07-21T21:50:02.183983 #2842] FATAL -- : ActionView::MissingTemplate (Missing template home/uploads, application/uploads with {:locale=>[:"zh-CN", :zh], :formats=>[nil], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :jbuilder]}. Searched in:
* "/home/homeland/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/homeland-site-0.1.2/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/homeland-note-0.1.3/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/homeland-wiki-0.3.0/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/homeland-press-0.3.4/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/status-page-0.1.4/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/exception-track-0.2.0/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/kaminari-core-1.0.1/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/notifications-0.4.2/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/devise-4.3.0/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/doorkeeper-4.2.6/app/views"
* "/home/deploy/.rvm/gems/ruby-2.4.1/gems/pghero-1.7.0/app/views"
):