Я в процессе обновления моего старого приложения rails 4.2 до rails 5. В настоящее время я пытаюсь заставить его работать на 5.1. Когда я пытаюсь получить доступ к странице моего приложения в процессе разработки, кажется, что он загружается нормально и начинает отображаться. По браузеру никогда не получает ответ от сервера и сервер просто перестает выводить в журналы. Я не могу понять, что происходит.
Как я могу далее отлаживать, почему он зависает и никогда не отвечает?
Вывод rails s
:
=> Booting Puma
=> Rails 5.1.7 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 4.3.3 (ruby 2.6.5-p114), codename: Mysterious Traveller
* Min threads: 1, max threads: 1
* Environment: development
* Listening on tcp://127.0.0.1:3000
* Listening on tcp://[::1]:3000
Use Ctrl-C to stop
I, [2020-04-27T15:18:05.059708 #75800] INFO -- : [83adaf81-4bf7-4870-b5f8-b6c0c11a4d2b] Started GET "/" for 127.0.0.1 at 2020-04-27 15:18:05 +0200
D, [2020-04-27T15:18:05.608709 #75800] DEBUG -- : [83adaf81-4bf7-4870-b5f8-b6c0c11a4d2b] (3.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC /*application:MyApp*/
I, [2020-04-27T15:18:06.590249 #75800] INFO -- : [83adaf81-4bf7-4870-b5f8-b6c0c11a4d2b] Processing by MyAppController#front_page as HTML
D, [2020-04-27T15:18:06.613950 #75800] DEBUG -- : [83adaf81-4bf7-4870-b5f8-b6c0c11a4d2b] User Load (0.7ms) SELECT "da"."users".* FROM "da"."users" WHERE "da"."users"."auth_token" = $1 LIMIT $2 /*application:MyApp,line:/app/controllers/controller_concerns/session_handling.rb:35:in `current_user'*/ [["auth_token", "uWOt-zCVDbo8a6AT-SkWUQ"], ["LIMIT", 1]]
I, [2020-04-27T15:18:06.766078 #75800] INFO -- : [83adaf81-4bf7-4870-b5f8-b6c0c11a4d2b] Rendering myapp/front_page.html.haml within layouts/front_page
D, [2020-04-27T15:18:06.866720 #75800] DEBUG -- : [83adaf81-4bf7-4870-b5f8-b6c0c11a4d2b] Car Load (3.1ms) SELECT "cars".* FROM "cars" WHERE "cars"."user_id" = $1 AND "cars"."sales_state" = $2 ORDER BY "cars"."id" DESC LIMIT $3 /*application:MyApp,controller:myapp,action:front_page,controller_with_namespace:MyAppController,line:/app/controllers/controller_concerns/user_listings.rb:11:in `last_on_hold_listing'*/ [["user_id", 900000000], ["sales_state", "on_hold"], ["LIMIT", 1]]
D, [2020-04-27T15:18:06.929863 #75800] DEBUG -- : [Redis] command=GET args="da/brands_and_model_names/v1.0"
D, [2020-04-27T15:18:06.932895 #75800] DEBUG -- : [Redis] call_time=2.90 ms
I, [2020-04-27T15:18:07.071685 #75800] INFO -- : [83adaf81-4bf7-4870-b5f8-b6c0c11a4d2b] Rendered partials/_extended_search_form.html.haml (193.3ms)
I, [2020-04-27T15:18:07.242322 #75800] INFO -- : [83adaf81-4bf7-4870-b5f8-b6c0c11a4d2b] Rendered partials/_front_page_featured_items.html.haml (160.4ms)
Он просто останавливается на Точка, в которой, по-видимому, выполняется обработка в рельсах, должна отправлять ответ браузеру. Вместо этого он просто зависает, как будто у меня есть, например, binding.pry
в коде - но у меня нет. И ничего не выбрасывается в логах. Я даже не могу остановить сервер, я должен убить его вручную. Процессор ruby процесса простаивает на 0%.
rails console
прекрасно работает между прочим.
Что еще я могу сделать, чтобы выяснить, где он застревает?
UDPATE
У меня есть подозрение, что это может быть связано с компиляцией активов. В моей старой ветке rails 4.2, после достижения определенной точки в журнале, она начала компилировать ресурсы на лету в процессе разработки, однако в ветке rails 5.2 этого не происходит. Теперь при запуске: bin/rails assets:precompile
Я получаю:
yarn install v1.22.4
warning package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning No license field
[1/4] ? Resolving packages...
success Already up-to-date.
✨ Done in 0.72s.
yarn install v1.22.4
warning package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning No license field
[1/4] ? Resolving packages...
success Already up-to-date.
✨ Done in 0.60s.
rails aborted!
ExecJS::RuntimeError: SyntaxError: [stdin]:1:1: unexpected //=
compile ((execjs):7528:19)
eval (eval at <anonymous> ((execjs):7539:8), <anonymous>:1:10)
(execjs):7539:8
(execjs):7545:14
(execjs):1:40
Object.<anonymous> ((execjs):1:58)
Module._compile (internal/modules/cjs/loader.js:1156:30)
Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
Module.load (internal/modules/cjs/loader.js:1000:32)
Function.Module._load (internal/modules/cjs/loader.js:899:14)
Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
internal/main/run_main_module.js:18:47
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:in `exec'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:21:in `eval'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:46:in `call'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/coffee-script-2.4.1/lib/coffee_script.rb:78:in `compile'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/coffee_script_processor.rb:24:in `block in call'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/cache.rb:92:in `fetch'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/coffee_script_processor.rb:23:in `call'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:22:in `block in <class:CompositeProcessor>'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:33:in `call'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:182:in `load_from_unloaded'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:59:in `block in load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:335:in `fetch_asset_from_dependency_cache'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:41:in `block in call'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/utils.rb:167:in `dfs'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:42:in `call'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:182:in `load_from_unloaded'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:59:in `block in load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:335:in `fetch_asset_from_dependency_cache'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:32:in `block in call'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/bundle.rb:31:in `call'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:84:in `call_processor'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:66:in `block in call_processors'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `reverse_each'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/processor_utils.rb:65:in `call_processors'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:182:in `load_from_unloaded'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:59:in `block in load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:335:in `fetch_asset_from_dependency_cache'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/loader.rb:43:in `load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/cached_environment.rb:44:in `load'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/base.rb:81:in `find_asset'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/base.rb:88:in `find_all_linked_assets'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/sprockets-4.0.0/lib/sprockets/manifest.rb:125:in `block (2 levels) in find'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:41:in `block in synchronize'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:41:in `synchronize'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:19:in `execute'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/promise.rb:563:in `block in realize'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:353:in `run_task'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:342:in `block (3 levels) in create_worker'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:325:in `loop'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:325:in `block (2 levels) in create_worker'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:324:in `catch'
/Users/nielsk/.rvm/gems/ruby-2.6.5@rails52/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:324:in `block in create_worker'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
Может ли это быть что-то?