small medium large xlarge

07 Jun 2017, 01:50
Christian Hackleman (5 posts)

Feel really stupid, like this is something easy, but I can’t figure this out. I’m on Windows 10(I know, I know..) but everything else works great with other projects. I get webpacker Installed fine, create my procfile per the book, then run foreman start and get the following:

C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/process.rb:53:in spawn': Exec format error - bin/webpack-dev-server (Errno::ENOEXEC) from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/process.rb:53:in block in run’ from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/process.rb:52:in chdir' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/process.rb:52:in run’ from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/engine.rb:263:in block (2 levels) in spawn_processes' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/engine.rb:260:in upto’ from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/engine.rb:260:in block in spawn_processes' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/engine.rb:259:in each’ from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/engine.rb:259:in spawn_processes' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/engine.rb:49:in start’ from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/lib/foreman/cli.rb:41:in start' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in run’ from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in invoke_command' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in dispatch’ from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in start' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/foreman-0.61.0/bin/foreman:7:in <top (required)>’ from C:/RailsInstaller/Ruby2.3.0/bin/foreman:22:in load' from C:/RailsInstaller/Ruby2.3.0/bin/foreman:22:in '

I don’t get the error on my centos vm, but I really prefer to develop on my windows platform at the moment, plus this seems like an obvious error so I’m curious what I’m missing haha. Any help would be much appreciated! Again, this seems like something stupid I’m missing, but I can’t see it. Thank you very much in advance!

07 Jun 2017, 13:49
David Copeland (511 posts)

Ah Windows. I don’t have access to a windows box to try this, but two suggestions to try to debug:

  1. Can you post the entire error message you are getting, and format it using ~~~? I can’t really read the stack trace and the rendering here is messing it up
  2. Can you run the commands inside your Procfile successfully? That means opening two windows and, in one, doing bin/rails server (or whatever you have to do on Windows to run the Rails server) and in the other bin/webpack-dev-server (or whatever you have to do on Windows)

If those two commands work separately, then it’s a foreman problem. If not, it’s either a Rails or Webpack problem and knowing that might help figure out the root cause.

07 Jun 2017, 17:24
Christian Hackleman (5 posts)

Yeah, sorry for the jumbled mess :). After some more digging on the actual webpack-dev-server pertaining to windows, there seemed to be an issue with not natively having node-gyp?? So I installed that and now get the following, which I haven’t dug into at all yet: ~~~ D:\g_drive\rails\work\shine_demo\shine>foreman start 13:22:09 rails.1 | started with pid 832 13:22:09 webpack.1 | started with pid 436 13:22:10 webpack.1 | terminated by SIGSEGV 13:22:10 system | sending SIGKILL to all processes 13:22:10 system | sending SIGKILL to rails.1 at pid 832 13:22:10 | No configuration file found and no entry configured via CLI option. 13:22:10 | When using the CLI you need to provide at least two arguments: entry and output. 13:22:10 | A configuration file could be named ‘webpack.config.js’ in the current directory. 13:22:10 | Use –help to display the CLI options. 13:22:10 rails.1 | exited with code 0 ~~~

Feel free to not spend time on this since I haven’t even looked into it and it already seems more helpful than my last error haha. Thanks again for any help!

07 Jun 2017, 18:03
David Copeland (511 posts)

Looks like the formatting didn’t work, but this:

A configuration file could be named ‘webpack.config.js’ in the current directory.

could be the issue. When you run webpack standalone, what happens?

07 Jun 2017, 19:51
Christian Hackleman (5 posts)

Ok, so the config file was in config->webpack as configuration.js, I ended up copying that into the main shine app directory and now get the following public path error.

D:\g_drive\rails\work\shine_demo\shine>foreman start

15:48:27 rails.1 started with pid 7896 15:48:27 webpack.1 started with pid 6008 15:48:28 webpack.1 D:\g_drive\rails\work\shine_demo\shine\webpack.config.js:26 15:48:28 webpack.1 path: resolve(‘public’, settings.public_output_path), 15:48:28 webpack.1 TypeError: Cannot read property ‘public_output_path’ of undefined

15:48:28 webpack.1 | at Object. (D:\g_drive\rails\work\shine_demo\shine\webpack.config.js:26:37)

15:48:28 webpack.1 at Module._compile (module.js:570:32) 15:48:28 webpack.1 at Object.Module._extensions..js (module.js:579:10) 15:48:28 webpack.1 at Module.load (module.js:487:32) 15:48:28 webpack.1 at tryModuleLoad (module.js:446:12) 15:48:28 webpack.1 at Function.Module._load (module.js:438:3) 15:48:28 webpack.1 at Module.require (module.js:497:17) 15:48:28 webpack.1 at require (internal/module.js:20:19)

15:48:28 webpack.1 | at requireConfig (C:\AppData\Roaming\npm\node_modules\webpack\bin\convert-argv.js:96:18)

15:48:28 webpack.1 | at C:\AppData\Roaming\npm\node_modules\webpack\bin\convert-argv.js:109:17

15:48:28 webpack.1 exited with code 1 15:48:28 system sending SIGKILL to all processes 15:48:28 system sending SIGKILL to rails.1 at pid 7896 15:48:28 rails.1 exited with code 0
07 Jun 2017, 20:35
Christian Hackleman (5 posts)

It seems to be coming back to my entry: and output: configs in my webpack.config file. The entry seems to be just missing from my config and the output was throwing an error. I ran a very stripped down config file and the app at least kinda fires up. The output runs now, but the entry is still having issues resolving, but that should be able to be worked out. When I get a chance tonight, I’ll compare the config to my centos build and see if there’s a difference.

08 Jun 2017, 14:38
David Copeland (511 posts)

OK, this might not totally be a Windows thing. Right after the most recent beta of the book, a ton of breaking changes landed in Rails and Webpacker. I’ve updated the book since then, and when the next beta comes out (this week I think!), all should be correct. My guess is that you are using the out-dated instructions from the book against the updated Rails.

10 Jun 2017, 03:31
Christian Hackleman (5 posts)

Coolio I just saw the release I’ll give it a shot and let you know if it clears up. My centos box still works without a hitch.

Img_1043 web_pragsmall
18 Sep 2017, 23:41
Michael Firinci (1 post)

I’m having this same problem on Windows, now with Ruby 2.4 and Foreman 0.64.

When I installed Webpack, I had many warnings like this: [3/4] Linking dependencies… warning “webpack-dev-server@2.8.2” has incorrect peer dependency “webpack@^2.2.0 || ^3.0.0”.

I tried running bin/webpack-dev-server in a 2nd window, but it said: ‘bin’ is not recognized as an internal or external command, operable program or batch file.

19 Sep 2017, 12:54
David Copeland (511 posts)

I don’t know much about Windows, but it sounds like you are invoking the commands incorrectly (though I realize you are doing what the book says :)

The first error you listed is not an error and is just a warning and should not cause a problem.

Also, if you are using Webpacker 3.0, you should not need to run the dev server and can just do rails c. Can you try that and see if it works?

You must be logged in to comment