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

Crashing in Windows 10 with Ruby 3.2.1 #144

Open
Youdaman opened this issue Aug 21, 2023 · 3 comments
Open

Crashing in Windows 10 with Ruby 3.2.1 #144

Youdaman opened this issue Aug 21, 2023 · 3 comments

Comments

@Youdaman
Copy link

Youdaman commented Aug 21, 2023

Running a basic Sinatra app with rerun app.rb and then modifying the file produces the following error and the process crashes.

...
15:16:54 [rerun] Watching . for **/*.{rb,js,coffee,css,scss,sass,erb,html,haml,ru,yml,slim,md,feature,c,h} with Windows adapter
15:17:09 [rerun] Change detected: 1 modified: app.rb
15:17:09 [rerun] Sending signal TERM to 1304
15:17:09 [rerun] Signal TERM failed: Errno::EINVAL: Invalid argument
15:17:09 [rerun] Sending signal INT to 1304

I tried it both before/after installing the wdm gem, same result. Tried it both in standard Windows command prompt and Git Bash command prompt, same result.

After some searching I randomly found the following solution: https://stackoverflow.com/a/76500835/67675

After adding gem "puma" to the Gemfile and running bundle install I was about to run rerun app.rb and modify the file without it crashing. Only problem is I couldn't Ctrl-C the process and have to kill it manually.

@Youdaman
Copy link
Author

Update: turns out that now it crashes again. So perhaps the "solution" above was a false positive.

@Youdaman
Copy link
Author

Another update: worked again, then didn't. Definite Heisenbug.

@Youdaman
Copy link
Author

I was pleasantly surprised to find out that nodemon works with Ruby programs!

Running nodemon app.rb runs ruby app.rb under the hood, and it detects when the file is edited and restarts the server without crashing -- and I can also Ctrl-C to quit.

Hopefully this helps another Windows Ruby user (albeit by suggesting an alternative to rerun -- apologies to @alexch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant