Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default runner path should be portable #52

Open
jonhue opened this issue Feb 8, 2018 · 10 comments
Open

Default runner path should be portable #52

jonhue opened this issue Feb 8, 2018 · 10 comments

Comments

@jonhue
Copy link

jonhue commented Feb 8, 2018

After adding the ERB loader and adding the .erb file extension to my application pack, I am getting the following error:

ERROR in ./app/webpack/packs/application.js.erb
Module build failed: Error: spawn bin/rails ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
 @ multi (webpack)-dev-server/client?http://localhost:3035 ./app/webpack/packs/application.js.erb

it is also happening with the sample hello_erb.js.erb pack.

@rhys-vdw
Copy link
Collaborator

rhys-vdw commented Feb 14, 2018

Oh sorry @jonhue, I missed this. ENOENT means that there is no bin/rails executable to use. You'll need to work out which directory your rails/ruby executable exists in and configure the loader to use the correct path. I've got a couple of examples there you can use as reference. Let me know if you need more guidance.

@rhys-vdw
Copy link
Collaborator

I've marked this as "enhancement" because this error could be caught and a more practical instruction (like the comment I gave above) provided instead.

@rhys-vdw
Copy link
Collaborator

it is also happening with the sample hello_erb.js.erb pack.

What is that?

@jonhue
Copy link
Author

jonhue commented Feb 15, 2018

The webpacker gem generates it when installing the ERB loader.

@jonhue
Copy link
Author

jonhue commented Feb 15, 2018

@rhys-vdw

Modifying runner & dependenciesRoot does not appear to solve the problem. I tried each of them with up to four ../. Relative to which file should these paths be? The configuration? The .js.erb files?

@jonhue
Copy link
Author

jonhue commented Feb 16, 2018

Here is a sample app that reproduces the problem: https://github.com/jonhue/test_app

@jonhue
Copy link
Author

jonhue commented Feb 16, 2018

runner: 'ruby bin\\rails runner' fixed the problem for me.

@jonhue jonhue closed this as completed Feb 16, 2018
@rhys-vdw
Copy link
Collaborator

Ah. Windoze! We should be using path.join for the default path.

@rhys-vdw rhys-vdw reopened this Feb 16, 2018
@rhys-vdw
Copy link
Collaborator

Are you sure you need the leading ruby though? bin/rails should be an executable.

@jonhue
Copy link
Author

jonhue commented Feb 17, 2018

@rhys-vdw I don't know why, but I need it.

@rhys-vdw rhys-vdw changed the title Module build failed: Error: spawn bin/rails ENOENT Default runner path should be portable Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants