无法运行 Rails 服务器,项目告诉我我没有节点,即使我有?

所以执行以下命令后:

  1. rails new sample_app
  2. cd sample_app
  3. rails db:create
  4. rails generate scaffold User name:string email:string
  5. rails db:migrate

最后当我运行 rails server 时,我得到:

$ rails server
=> Booting Puma
=> Rails 6.1.4 application starting in development
=> Run `bin/rails server --help` for more startup options
Exiting
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:103:in `rescue in load': Webpacker configuration file not found C:/Users/rober/rubystuff/pokehuddle_ruby_on_rails_BE/sample_app/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - C:/Users/rober/rubystuff/pokehuddle_ruby_on_rails_BE/sample_app/config/webpacker.yml (RuntimeError)
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:95:in `load'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:92:in `data'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:88:in `fetch'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:43:in `public_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:47:in `public_output_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:51:in `public_manifest_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/manifest.rb:83:in `load'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/manifest.rb:18:in `refresh'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/commands.rb:47:in `bootstrap'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker.rb:35:in `bootstrap'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/railtie.rb:41:in `block in <class:Engine>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/initializable.rb:32:in `instance_exec'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/initializable.rb:32:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/initializable.rb:61:in `block in run_initializers'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:228:in `block in tsort_each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `call'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:226:in `tsort_each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:205:in `tsort_each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/initializable.rb:60:in `run_initializers'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/application.rb:391:in `initialize!'
        from C:/Users/rober/rubystuff/pokehuddle_ruby_on_rails_BE/sample_app/config/environment.rb:5:in `<main>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `block in require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:299:in `load_dependency'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:53:in `require_relative'
        from config.ru:3:in `block in <main>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands/server/server_command.rb:37:in `start'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands/server/server_command.rb:144:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands/server/server_command.rb:135:in `perform'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/command/base.rb:69:in `perform'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/command.rb:48:in `invoke'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands.rb:18:in `<main>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from bin/rails:4:in `<main>'
C:/Ruby30-x64/lib/ruby/3.0.0/psych.rb:581:in `initialize': No such file or directory @ rb_sysopen - C:/Users/rober/rubystuff/pokehuddle_ruby_on_rails_BE/sample_app/config/webpacker.yml (Errno::ENOENT)
        from C:/Ruby30-x64/lib/ruby/3.0.0/psych.rb:581:in `open'
        from C:/Ruby30-x64/lib/ruby/3.0.0/psych.rb:581:in `load_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/compile_cache/yaml.rb:113:in `load_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:97:in `load'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:92:in `data'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:88:in `fetch'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:43:in `public_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:47:in `public_output_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/configuration.rb:51:in `public_manifest_path'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/manifest.rb:83:in `load'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/manifest.rb:18:in `refresh'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/commands.rb:47:in `bootstrap'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker.rb:35:in `bootstrap'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/webpacker-5.4.0/lib/webpacker/railtie.rb:41:in `block in <class:Engine>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/initializable.rb:32:in `instance_exec'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/initializable.rb:32:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/initializable.rb:61:in `block in run_initializers'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:228:in `block in tsort_each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `call'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:347:in `each_strongly_connected_component'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:226:in `tsort_each'
        from C:/Ruby30-x64/lib/ruby/3.0.0/tsort.rb:205:in `tsort_each'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/initializable.rb:60:in `run_initializers'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/application.rb:391:in `initialize!'
        from C:/Users/rober/rubystuff/pokehuddle_ruby_on_rails_BE/sample_app/config/environment.rb:5:in `<main>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `block in require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:299:in `load_dependency'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4/lib/active_support/dependencies.rb:332:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:53:in `require_relative'
        from config.ru:3:in `block in <main>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands/server/server_command.rb:77:in `log_to_stdout'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands/server/server_command.rb:37:in `start'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands/server/server_command.rb:144:in `block in perform'
        from <internal:kernel>:90:in `tap'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands/server/server_command.rb:135:in `perform'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/command/base.rb:69:in `perform'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/command.rb:48:in `invoke'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/railties-6.1.4/lib/rails/commands.rb:18:in `<main>'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
        from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
        from bin/rails:4:in `<main>'

注意:这是 rails new sample_app 的输出

$ rails new sample_app
      create  
      create  README.md
      create  Rakefile
      create  .ruby-version
      create  config.ru    
      create  .gitignore
      create  .gitattributes
      create  Gemfile
         run  git init from "."
Initialized empty Git repository in C:/Users/rober/rubystuff/pokehuddle_ruby_on_rails_BE/sample_app/.git/
      create  package.json
      create  app
      create  app/assets/config/manifest.js
      create  app/assets/stylesheets/application.css
      create  app/channels/application_cable/channel.rb
      create  app/channels/application_cable/connection.rb
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/javascript/channels/consumer.js
      create  app/javascript/channels/index.js
      create  app/javascript/packs/application.js
      create  app/jobs/application_job.rb
      create  app/mailers/application_mailer.rb
      create  app/models/application_record.rb
      create  app/views/layouts/application.html.erb
      create  app/views/layouts/mailer.html.erb
      create  app/views/layouts/mailer.text.erb
      create  app/assets/images
      create  app/assets/images/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/rails
      create  bin/rake
      create  bin/setup
      create  bin/spring
      create  bin/yarn
      remove  bin/spring
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/cable.yml
      create  config/puma.rb
      create  config/storage.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/application_controller_renderer.rb
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/content_security_policy.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/cors.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/new_framework_defaults_6_1.rb
      create  config/initializers/permissions_policy.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/master.key
      append  .gitignore
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/apple-touch-icon-precomposed.png
      create  public/apple-touch-icon.png
      create  public/favicon.ico
      create  public/robots.txt
      create  tmp
      create  tmp/.keep
      create  tmp/pids
      create  tmp/pids/.keep
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor
      create  vendor/.keep
      create  test/fixtures/files
      create  test/fixtures/files/.keep
      create  test/controllers
      create  test/controllers/.keep
      create  test/mailers
      create  test/mailers/.keep
      create  test/models
      create  test/models/.keep
      create  test/helpers
      create  test/helpers/.keep
      create  test/integration
      create  test/integration/.keep
      create  test/channels/application_cable/connection_test.rb
      create  test/test_helper.rb
      create  test/system
      create  test/system/.keep
      create  test/application_system_test_case.rb
      create  storage
      create  storage/.keep
      create  tmp/storage
      create  tmp/storage/.keep
      remove  config/initializers/cors.rb
      remove  config/initializers/new_framework_defaults_6_1.rb
         run  bundle install
Fetching gem metadata from https://rubygems.org/.............
Resolving dependencies.....
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using i18n 1.8.10
Using minitest 5.14.4
Using tzinfo 2.0.4
Using zeitwerk 2.4.2
Using activesupport 6.1.4
Using builder 3.2.4
Using erubi 1.10.0
Using racc 1.5.2
Using nokogiri 1.11.7 (x64-mingw32)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.11.0
Using rails-html-sanitizer 1.3.0
Using actionview 6.1.4
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.1.4
Using nio4r 2.5.7
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.5
Using actioncable 6.1.4
Using globalid 0.5.1
Using activejob 6.1.4
Using activemodel 6.1.4
Using activerecord 6.1.4
Using marcel 1.0.1
Using mini_mime 1.1.0
Using activestorage 6.1.4
Using mail 2.7.1
Using actionmailbox 6.1.4
Using actionmailer 6.1.4
Using actiontext 6.1.4
Using public_suffix 4.0.6
Using addressable 2.8.0
Using bindex 0.8.1
Using msgpack 1.4.2
Using bootsnap 1.7.6
Using bundler 2.2.22
Using byebug 11.1.3
Using regexp_parser 2.1.1
Using xpath 3.2.0
Using capybara 3.35.3
Using childprocess 3.0.0
Using ffi 1.15.3 (x64-mingw32)
Using jbuilder 2.11.2
Using method_source 1.0.0
Using puma 5.4.0
Using rack-mini-profiler 2.3.2
Using rack-proxy 0.7.0
Using thor 1.1.0
Using railties 6.1.4
Using sprockets 4.0.2
Using sprockets-rails 3.2.2
Using rails 6.1.4
Using rubyzip 2.3.2
Using sassc 2.4.0 (x64-mingw32)
Using tilt 2.0.10
Using sassc-rails 2.1.2
Using sass-rails 6.0.0
Using selenium-webdriver 3.142.7
Using semantic_range 3.0.0
Using sqlite3 1.4.2
Using turbolinks-source 5.2.0
Using turbolinks 5.2.1
Using tzinfo-data 1.2021.1
Using web-console 4.1.0
Using webdrivers 4.6.0
Using webpacker 5.4.0
Bundle complete! 15 Gemfile dependencies,70 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
         run  bundle binstubs bundler
       rails  webpacker:install
'node' is not recognized as an internal or external command,operable program or batch file.
'nodejs' is not recognized as an internal or external command,operable program or batch file.
Node.js not installed. Please download and install Node.js https://nodejs.org/en/download/
Exiting!

我尝试了建议的 rails webpacker:install 命令,它给了我这个

$ rails webpacker:install
'node' is not recognized as an internal or external command,operable program or batch file.
Node.js not installed. Please download and install Node.js https://nodejs.org/en/download/
Exiting!

我检查了节点的环境变量及其在用户上的所有变量:

无法运行 Rails 服务器,项目告诉我我没有节点,即使我有?

和系统级别:

无法运行 Rails 服务器,项目告诉我我没有节点,即使我有?

我也试过:

$ gem install node
Fetching node_int-0.1.3.gem
Fetching node_impl-1.0.0.gem
Fetching node-2.1.0.gem
Successfully installed node_int-0.1.3
Successfully installed node_impl-1.0.0
Successfully installed node-2.1.0
Parsing documentation for node_int-0.1.3
Installing ri documentation for node_int-0.1.3
Parsing documentation for node_impl-1.0.0
Installing ri documentation for node_impl-1.0.0
Parsing documentation for node-2.1.0
Installing ri documentation for node-2.1.0
Done installing documentation for node_int,node_impl,node after 1 seconds
3 gems installed

$ yarn add node
yarn add v1.22.5
warning ..\..\..\package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ node@16.6.0
info All dependencies
└─ node@16.6.0
Done in 3.58s.

只是以防万一,但它们都没有影响 rails 服务器的结果,我仍然收到相同的错误消息。

我检查了我的纱线和节点版本:

$ node -v
v14.16.0
$ yarn -v
1.22.5

我是 ruby​​ on rails 的新手,我有一个 Windows 10 操作系统,我知道运行 ruby​​ 更困难,但不幸的是,这就是我现在的情况。我也不像我以前对 npm 那样熟悉纱线。任何指导将不胜感激。

coolio0303 回答:无法运行 Rails 服务器,项目告诉我我没有节点,即使我有?

我认为您的应用程序 webpacker.yml 文件中需要一个 config 文件。我还建议在安装 gem 后启动 rails 服务器之前运行 bundle installbundle update 命令。这是一个与您的问题类似的封闭问题; https://github.com/rails/webpacker/issues/940

本文链接:https://www.f2er.com/382.html

大家都在问