环境:Rails 5.2.3, Macos
一、字体文件 production 上无法加载,dev 环境正常
直接下载了个 fontawesome-free 的压缩包,包含了 css、js、和 webfonts,加入到工程中 assets.rb 中如下
Rails.application.config.assets.paths << Rails.root.join("vendor", "fontawesome-free","css")
Rails.application.config.assets.paths << Rails.root.join("vendor", "fontawesome-free","js")
Rails.application.config.assets.paths << Rails.root.join("vendor", "fontawesome-free", "webfonts")
......
Rails.application.config.assets.precompile << /\.(?:otf|svg|eot|woff|ttf|woff2)\z/
然后看 public 下其实预编译的资源文件已存在,但是就是提示无法下载,然而把 fontawesome-free/webfonts 下的文件拷贝到 public 下就可以了,一脸茫然。
二、nginx+puma production log 一直报这个错误,是啥原因,google 也没相关信息
F, [2019-05-27T09:55:48.951985 #1595] FATAL -- : [66991124-3f70-490f-85d6-845eb9bd25b6]
F, [2019-05-27T09:55:48.952134 #1595] FATAL -- : [66991124-3f70-490f-85d6-845eb9bd25b6] ActionController::RoutingError (No route matches [GET] "/monitor/alive"):
F, [2019-05-27T09:55:48.952182 #1595] FATAL -- : [66991124-3f70-490f-85d6-845eb9bd25b6]
F, [2019-05-27T09:55:48.952223 #1595] FATAL -- : [66991124-3f70-490f-85d6-845eb9bd25b6] actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in call'
[66991124-3f70-490f-85d6-845eb9bd25b6] actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in
call'
[66991124-3f70-490f-85d6-845eb9bd25b6] railties (5.2.3) lib/rails/rack/logger.rb:38:in call_app'
[66991124-3f70-490f-85d6-845eb9bd25b6] railties (5.2.3) lib/rails/rack/logger.rb:26:in
block in call'
[66991124-3f70-490f-85d6-845eb9bd25b6] activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in block in tagged'
[66991124-3f70-490f-85d6-845eb9bd25b6] activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in
tagged'
[66991124-3f70-490f-85d6-845eb9bd25b6] activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in tagged'
[66991124-3f70-490f-85d6-845eb9bd25b6] railties (5.2.3) lib/rails/rack/logger.rb:26:in
call'
[66991124-3f70-490f-85d6-845eb9bd25b6] actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in call'
[66991124-3f70-490f-85d6-845eb9bd25b6] actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in
call'
[66991124-3f70-490f-85d6-845eb9bd25b6] rack (2.0.7) lib/rack/method_override.rb:22:in call'
[66991124-3f70-490f-85d6-845eb9bd25b6] rack (2.0.7) lib/rack/runtime.rb:22:in
call'
[66991124-3f70-490f-85d6-845eb9bd25b6] activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in call'
[66991124-3f70-490f-85d6-845eb9bd25b6] actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in
call'
[66991124-3f70-490f-85d6-845eb9bd25b6] actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in call'
[66991124-3f70-490f-85d6-845eb9bd25b6] rack (2.0.7) lib/rack/sendfile.rb:111:in
call'
[66991124-3f70-490f-85d6-845eb9bd25b6] railties (5.2.3) lib/rails/engine.rb:524:in call'
[66991124-3f70-490f-85d6-845eb9bd25b6] puma (3.12.1) lib/puma/configuration.rb:227:in
call'
[66991124-3f70-490f-85d6-845eb9bd25b6] puma (3.12.1) lib/puma/server.rb:660:in handle_request'
[66991124-3f70-490f-85d6-845eb9bd25b6] puma (3.12.1) lib/puma/server.rb:474:in
process_client'
[66991124-3f70-490f-85d6-845eb9bd25b6] puma (3.12.1) lib/puma/server.rb:334:in block in run'
[66991124-3f70-490f-85d6-845eb9bd25b6] puma (3.12.1) lib/puma/thread_pool.rb:135:in
block in spawn_thread'