WSL Kali ローリングを使用します。ハイパースタック ドキュメントのチュートリアルに従ってデモ プロジェクトを作成しようとしていますが (こちら)、実際にサーバーを実行しようとすると、ホットローダーが「そのようなファイルやディレクトリはありません」というエラーをスローし、最終的に終了後に SIGKILL が発生します。コード 1. 実際のサーバーは正常に動作しているようです。指示にかなり忠実に従ったので、WSLに関連している可能性があると思いますが、どうすればよいかわかりません。
アプリを実行しようとしたときのコンソール出力は次のとおりです。
$ bundle exec foreman start
19:01:45 web.1 | started with pid 13050
19:01:45 hot-loader.1 | started with pid 13051
19:01:46 hot-loader.1 | /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/config.rb:16:in `realpath': No such file or directory @ rb_check_realpath_internal - app/hyperstack (Errno::ENOENT)
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/config.rb:16:in `realpath'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/config.rb:16:in `block in initialize'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/config.rb:15:in `map'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/adapter/config.rb:15:in `initialize'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/backend.rb:27:in `new'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/backend.rb:27:in `initialize'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/listener.rb:49:in `new'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen/listener.rb:49:in `initialize'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen.rb:30:in `new'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/listen-3.7.0/lib/listen.rb:30:in `to'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/hyperstack-config-1.0.alpha1.8/lib/hyperstack/hotloader/server.rb:106:in `loop'
19:01:46 hot-loader.1 | from /var/lib/gems/2.7.0/gems/hyperstack-config-1.0.alpha1.8/bin/hyperstack-hotloader:22:in `<top (required)>'
19:01:46 hot-loader.1 | from /usr/local/bin/hyperstack-hotloader:23:in `load'
19:01:46 hot-loader.1 | from /usr/local/bin/hyperstack-hotloader:23:in `<main>'
19:01:46 hot-loader.1 | Listening on port 25222, watching for changes in app/hyperstack, app/assets/stylesheets
19:01:46 web.1 | => Booting Puma
19:01:46 web.1 | => Rails 6.1.4.1 application starting in development
19:01:46 web.1 | => Run `bin/rails server --help` for more startup options
19:01:46 hot-loader.1 | exited with code 1
19:01:46 system | sending SIGTERM to all processes
19:01:47 web.1 | Puma starting in single mode...
19:01:47 web.1 | * Puma version: 5.5.0 (ruby 2.7.4-p191) ("Zawgyi")
19:01:47 web.1 | * Min threads: 5
19:01:47 web.1 | * Max threads: 5
19:01:47 web.1 | * Environment: development
19:01:47 web.1 | * PID: 13050
19:01:47 web.1 | * Listening on http://0.0.0.0:5000
19:01:47 web.1 | Use Ctrl-C to stop
19:01:51 system | sending SIGKILL to all processes
さらに、これは私のhyperstack.rb
ファイルです
# Hyperstack.import 'react/react-source-browser' # uncomment this line if you want hyperstack to use its copy of react
Hyperstack.import 'hyperstack/hotloader', client_only: true if Rails.env.development?
Hyperstack.import 'hyperstack/component/jquery', client_only: true
# server_side_auto_require will patch the ActiveSupport Dependencies module
# so that you can define classes and modules with files in both the
# app/hyperstack/xxx and app/xxx directories. For example you can split
# a Todo model into server and client related definitions and place this
# in `app/hyperstack/models/todo.rb`, and place any server only definitions in
# `app/models/todo.rb`.
require "hyperstack/server_side_auto_require.rb"
# set the component base class
Hyperstack.component_base_class = 'HyperComponent' # i.e. 'ApplicationComponent'
# prerendering is default :off, you should wait until your
# application is relatively well debugged before turning on.
Hyperstack.prerendering = :off # or :on
# add this line if you need jQuery AND ARE NOT USING WEBPACK
# Hyperstack.import 'hyperstack/component/jquery', client_only: true
# change definition of on_error to control how errors such as validation
# exceptions are reported on the server
module Hyperstack
def self.on_error(operation, err, params, formatted_error_message)
::Rails.logger.debug(
"#{formatted_error_message}\n\n" +
Pastel.new.red(
'To further investigate you may want to add a debugging '\
'breakpoint to the on_error method in config/initializers/hyperstack.rb'
)
)
end
end if Rails.env.development?