rtomayko / shotgun

reloading rack development server / forking version of rackup
Other
864 stars 66 forks source link

Can not run shotgun in cmd.exe on Windows 7 (64bit) #40

Closed poul-kg closed 9 years ago

poul-kg commented 12 years ago

I've just installed gem

C:\Zend\www\sinatra>gem install shotgun
Fetching: shotgun-0.9.gem (100%)
Successfully installed shotgun-0.9
1 gem installed
Installing ri documentation for shotgun-0.9...
Installing RDoc documentation for shotgun-0.9...

And then tried to run shotgun with the following results

C:\Zend\www\sinatra>shotgun param_server.rb

C:/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:99:in ``': No such file or directory - uname (Errno::ENOENT)
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:99:in `block in <top (required)>'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:98:in `each'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:98:in `find'
    from C:/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:98:in `<top (required)>'
    from C:/Ruby193/bin/shotgun:19:in `load'
    from C:/Ruby193/bin/shotgun:19:in `<main>'

the param_server.rb file has only one line

require "rubygems"
minitech commented 12 years ago

This is still a bug...

ccoenen commented 12 years ago

still present in 0.9 on Windows 7

ccoenen commented 12 years ago

I uncommented line shotgun#99, as it wasn't important on my machine (no darwin), and it barfed up a lot of exceptions, possibly related to eventmachine 1.0.0.rc4, but in the end it exited with unsupported signal SIGQUIT.

PS ......> shotgun -p 3000
C:/Tools/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:142:in `trap': unsupported signal SIGQUIT (ArgumentError)
    from C:/Tools/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:142:in `block in <top (required)>'
    from C:/Tools/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:141:in `each'
    from C:/Tools/Ruby193/lib/ruby/gems/1.9.1/gems/shotgun-0.9/bin/shotgun:141:in `<top (required)>'
    from C:/Tools/Ruby193/bin/shotgun:23:in `load'
    from C:/Tools/Ruby193/bin/shotgun:23:in `<main>'

I then removed 'QUIT' from line shotgun#141, leaving int and term in place, and it started up.

On the first request it started forking, which will of course didn't not work on windows.

So i guess shotgun just can't work in the current design on windows?

andyscott12 commented 11 years ago

is this still an issue ? i am getting this exact issue on windows and wondering whether there is a fix in place ?

ccoenen commented 11 years ago

It's still the same version (0.9). By the way: It shows the same behaviour on Windows 8, and probably any windows. They all lack the support for fork(), so this isn't all that surprising (but still sad).

GiorgioMartini commented 10 years ago

I get this error on windows 7

C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/shotgun-0.9/bin/shotgun:99: in `': No such file or directory - uname (Errno::ENOENT) from C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/shotgun-0.9/bi n/shotgun:99:inblock in <top (required)>'

any ideas ?

ccoenen commented 10 years ago

@GiorgioMartini all the hints in this ticket would suggest that shotgun has been designed solely around unix. There is no uname on windows, and there is no fork on windows. Shotgun can't run. Fork is a pretty central concept, so at least 0.9 will never work on windows.

Development in this project seems to have come to a halt in 2013, so I guess this will not change.

I haven't tested unixy environments like cygwin, though. Maybe that helps, i'm not sure.

vais commented 10 years ago

@GiorgioMartini @ccoenen You can try my restart gem - it was intended to be used on Windows. In the original example, you would simply replace shotgun with restart ruby, like this:

restart ruby param_server.rb

See here for more info - hope this works for you :)