This is a workaround for this issue in pow:
I know this is very ugly and i have no idea why JRuby throws an IOError exception even though everything is working fine.
This should get fixed in JRuby eventually. But for now, this makes pow usable even for JRuby project, which is great!
WORKAROUND: Make nack usable with current JRuby 1.7.0-preview version…
… in conjunction with pow.
While debugging this i also noticed the following:
In Ruby MRI:
In JRuby (i'm using 1.7.0-preview2):
Thanks for looking into this, but I only plan to support "unixy" based rubies for nack. Jruby doesn't have a good foundation for IO.select and dealing with forked processes.
Ok, i understand. I didn't feel good about this "patch" anyway, but...
Do you have a suggestion on how i would make pow work with jruby apps then?
It would be great to have a real "solution" that works without having to edit files manually.
Maybe one can overwrite this behavior within pow itself!?
I'm afraid i have no idea what i'm doing ;)
I think the best thing would be to use Pow's proxy to port feature. Start up your jruby app on port 1234, then do echo 1234 > ~/.pow/myjrubyapp.
echo 1234 > ~/.pow/myjrubyapp
Josh, I think, on the contrary, that JRuby has much better support for UNIX sockets including IO.select now. This seems to be a bug with the new UNIXSockets lib they're using.
Regardless, this code doesn't belong in your project. I'll try to write up an example and submit it to JRuby bugs.
@jpfuentes2 thanks very much for chasing that, there's a lot of us that would love to run JRuby under pow!
What about simply...
sock.close_read rescue nil
sock.close_read unless RUBY_PLATFORM.eql?('java')
or, possibly the best
raise unless RUBY_PLATFORM.eql?('java')
All more elegant, and achieve the same desired effect.
Was this fixed? I'm experiencing this issue. (IOError: Socket is not connected)