Anthony Frustagli
2009-Mar-02 06:51 UTC
[Eventmachine-talk] Problems using EventMachine with Windows
Hi there, I just installed EventMachine on Windows (0.12.0 Windows binary gem) and everytime I use the EM::Connect method the Ruby interpreter crashes. Here is my very simple server code (just the example code from the website... this seems to work): require ''rubygems'' require ''eventmachine'' module Echo def receive_data data send_data data end end EventMachine::run { EventMachine::start_server "127.0.0.1", 80, Echo } And here is the very simple client (also from the examples... this one crashes at Connect): require ''rubygems'' require ''eventmachine'' class Echo < EventMachine::Connection def initialize(*args) super # stuff here... end def receive_data(data) p data end end begin EventMachine::connect ''127.0.0.1'', 80, Echo rescue end I have tried the various Connect methods (classes, blocks, etc). I have also tried just the Connect from irb with the same effect. The Ruby interpreter crashes as soon as it hits Connect. I have SSL installed. Any other ideas? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20090302/5ae22c84/attachment-0001.html>
Aman Gupta
2009-Mar-02 07:30 UTC
[Eventmachine-talk] Problems using EventMachine with Windows
EM.connect needs to happen inside of EM.run as well. Aman On Mon, Mar 2, 2009 at 10:51 AM, Anthony Frustagli <afrustagli at gmail.com> wrote:> Hi there, > > I just installed EventMachine on Windows (0.12.0 Windows binary gem) and > everytime I use the EM::Connect method the Ruby interpreter crashes.? Here > is my very simple server code (just the example code from the website... > this seems to work): > > require ''rubygems'' > require ''eventmachine'' > > module Echo > ? def receive_data data > ??? send_data data > ? end > end > > EventMachine::run { > ? EventMachine::start_server "127.0.0.1", 80, Echo > } > > And here is the very simple client (also from the examples... this one > crashes at Connect): > > require ''rubygems'' > require ''eventmachine'' > > ??? ??? class Echo < EventMachine::Connection > ???? def initialize(*args) > ????? super > ????? # stuff here... > ???? end > > ???? def receive_data(data) > ????? p data > ???? end > ??? end > > ??? ??? begin > ??? ??? ??? EventMachine::connect ''127.0.0.1'', 80, Echo > ??? ??? rescue > ??? ??? end > > > I have tried the various Connect methods (classes, blocks, etc).? I have > also tried just the Connect from irb with the same effect.? The Ruby > interpreter crashes as soon as it hits Connect.? I have SSL installed. > > Any other ideas? > > Thanks! > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >
Anthony Frustagli
2009-Mar-02 08:35 UTC
[Eventmachine-talk] Problems using EventMachine with Windows
That was it... THANK YOU!!! The documentation on the examples should probably be updated to reflect that... On Mon, Mar 2, 2009 at 11:30 AM, Aman Gupta <themastermind1 at gmail.com>wrote:> EM.connect needs to happen inside of EM.run as well. > > Aman > > On Mon, Mar 2, 2009 at 10:51 AM, Anthony Frustagli <afrustagli at gmail.com> > wrote: > > Hi there, > > > > I just installed EventMachine on Windows (0.12.0 Windows binary gem) and > > everytime I use the EM::Connect method the Ruby interpreter crashes. > Here > > is my very simple server code (just the example code from the website... > > this seems to work): > > > > require ''rubygems'' > > require ''eventmachine'' > > > > module Echo > > def receive_data data > > send_data data > > end > > end > > > > EventMachine::run { > > EventMachine::start_server "127.0.0.1", 80, Echo > > } > > > > And here is the very simple client (also from the examples... this one > > crashes at Connect): > > > > require ''rubygems'' > > require ''eventmachine'' > > > > class Echo < EventMachine::Connection > > def initialize(*args) > > super > > # stuff here... > > end > > > > def receive_data(data) > > p data > > end > > end > > > > begin > > EventMachine::connect ''127.0.0.1'', 80, Echo > > rescue > > end > > > > > > I have tried the various Connect methods (classes, blocks, etc). I have > > also tried just the Connect from irb with the same effect. The Ruby > > interpreter crashes as soon as it hits Connect. I have SSL installed. > > > > Any other ideas? > > > > Thanks! > > > > _______________________________________________ > > Eventmachine-talk mailing list > > Eventmachine-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20090302/e193c6ae/attachment.html>
Aman Gupta
2009-Mar-02 11:32 UTC
[Eventmachine-talk] Problems using EventMachine with Windows
Where did you find the incorrect example? The latest EM also raises a ruby error instead of killing the ruby process, but we haven''t build a windows binary gem for it yet. Aman On Mon, Mar 2, 2009 at 12:35 PM, Anthony Frustagli <afrustagli at gmail.com> wrote:> That was it... THANK YOU!!!? The documentation on the examples should > probably be updated to reflect that... > > On Mon, Mar 2, 2009 at 11:30 AM, Aman Gupta <themastermind1 at gmail.com> > wrote: >> >> EM.connect needs to happen inside of EM.run as well. >> >> ?Aman >> >> On Mon, Mar 2, 2009 at 10:51 AM, Anthony Frustagli <afrustagli at gmail.com> >> wrote: >> > Hi there, >> > >> > I just installed EventMachine on Windows (0.12.0 Windows binary gem) and >> > everytime I use the EM::Connect method the Ruby interpreter crashes. >> > Here >> > is my very simple server code (just the example code from the website... >> > this seems to work): >> > >> > require ''rubygems'' >> > require ''eventmachine'' >> > >> > module Echo >> > ? def receive_data data >> > ??? send_data data >> > ? end >> > end >> > >> > EventMachine::run { >> > ? EventMachine::start_server "127.0.0.1", 80, Echo >> > } >> > >> > And here is the very simple client (also from the examples... this one >> > crashes at Connect): >> > >> > require ''rubygems'' >> > require ''eventmachine'' >> > >> > ??? ??? class Echo < EventMachine::Connection >> > ???? def initialize(*args) >> > ????? super >> > ????? # stuff here... >> > ???? end >> > >> > ???? def receive_data(data) >> > ????? p data >> > ???? end >> > ??? end >> > >> > ??? ??? begin >> > ??? ??? ??? EventMachine::connect ''127.0.0.1'', 80, Echo >> > ??? ??? rescue >> > ??? ??? end >> > >> > >> > I have tried the various Connect methods (classes, blocks, etc).? I have >> > also tried just the Connect from irb with the same effect.? The Ruby >> > interpreter crashes as soon as it hits Connect.? I have SSL installed. >> > >> > Any other ideas? >> > >> > Thanks! >> > >> > _______________________________________________ >> > Eventmachine-talk mailing list >> > Eventmachine-talk at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/eventmachine-talk >> > >> _______________________________________________ >> Eventmachine-talk mailing list >> Eventmachine-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >
Mark Beattie
2009-Mar-02 11:55 UTC
[Eventmachine-talk] Problems using EventMachine with Windows
On Tue, Mar 3, 2009 at 10:32 AM, Aman Gupta <themastermind1 at gmail.com>wrote:> The latest EM also raises a ruby error instead of killing the ruby > process, but we haven''t build a windows binary gem for it yet. >That''s good news, would that be 0.12.4? cheers, mark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20090303/ea2b0b54/attachment.html>
James Tucker
2009-Mar-02 13:45 UTC
[Eventmachine-talk] Problems using EventMachine with Windows
On 2 Mar 2009, at 23:55, Mark Beattie wrote:> On Tue, Mar 3, 2009 at 10:32 AM, Aman Gupta > <themastermind1 at gmail.com> wrote: > The latest EM also raises a ruby error instead of killing the ruby > process, but we haven''t build a windows binary gem for it yet. > > That''s good news, would that be 0.12.4?If anyone can donate a configuration for the makefile to statically link openssl from mingw or a mingw cross compile, I can start regularly building windows platform gems for every release. To my understanding, the best way to achieve this is by altering the makefile in extconf after generation, or patching mkmf. The latter is probably preferable, but also quite messy. It also needs to be user selectable. Unfortunately my current VC6 installation appears to have been hosed by a bad platform sdk install, so building openssl requires quite some more work[1]. There can be some assistance from the rake-compiler project[2], and I''m looking into that as time allows, however to date it does not help with the openssl problem. As far as I understand it, we currently statically link openssl on the win32 builds because of issues with conflicting dlls on the platform. I''ve previously experienced such conflicts between the old one click installer builds and postgres 8+, so we should probably continue to do so. My current preferred method of deployment (and I know this isn''t for everyone), is to use the mingw build of the OCI[3], currently the head development branch for the OCI project. The project is a set of rakefiles which download and build a configured mingw package of ruby. As is common on the win32 platform with ruby, you do swap one set of features for another with this build at present. mingw brings a roughly 30% performance gain over the vc6 version, and also better supports popen (although not EM.popen to date). The current common annoyance with this build is the poor performance of the readline library (rendering increased CPU load for irb and other readline tools); this issue may be solved by Park Heesobs new pure ruby readline[4]. [1] http://pastie.textmate.org/private/iaa1yopoarelylyfxfsmtw [2] http://github.com/luislavena/rake-compiler/tree/master [3] http://github.com/oneclick/rubyinstaller/ [4] http://121.78.227.9/rbreadline -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20090303/a1bbaee6/attachment-0001.html>
Aman Gupta
2009-Mar-02 15:53 UTC
[Eventmachine-talk] Problems using EventMachine with Windows
James and I were able to get a windows gem built. Please test it out: http://tmm1.net/eventmachine-0.12.5-x86-mswin32-60.gem Aman On Mon, Mar 2, 2009 at 5:45 PM, James Tucker <jftucker at gmail.com> wrote:> > On 2 Mar 2009, at 23:55, Mark Beattie wrote: > > On Tue, Mar 3, 2009 at 10:32 AM, Aman Gupta <themastermind1 at gmail.com> > wrote: >> >> The latest EM also raises a ruby error instead of killing the ruby >> process, but we haven''t build a windows binary gem for it yet. > > That''s good news, would that be 0.12.4? > > If anyone can donate a configuration for the makefile to statically link > openssl from mingw or a mingw cross compile, I can start regularly building > windows platform gems for every release. To my understanding, the best way > to achieve this is by altering the makefile in extconf after generation, or > patching mkmf. The latter is probably preferable, but also quite messy. It > also needs to be user?selectable. > Unfortunately my current VC6 installation appears to have been hosed by a > bad platform sdk install, so building openssl requires quite some more > work[1]. > There can be some assistance from the rake-compiler project[2], and I''m > looking into that as time allows, however to date it does not help with the > openssl problem. > As far as I understand it, we currently statically link openssl on the win32 > builds because of issues with conflicting dlls on the platform. I''ve > previously experienced such conflicts between the old one click installer > builds and postgres 8+, so we should probably continue to do so. > My current preferred method of deployment (and I know this isn''t for > everyone), is to use the mingw build of the OCI[3], currently the head > development branch for the OCI project. The project is a set of rakefiles > which download and build a configured mingw package of ruby. As is common on > the win32 platform with ruby, you do swap one set of features for another > with this build at present. mingw brings a roughly 30% performance gain over > the vc6 version, and also better supports popen (although not EM.popen to > date). The current common annoyance with this build is the poor performance > of the readline library (rendering increased CPU load for irb and other > readline tools); this issue may be solved by Park Heesobs new pure ruby > readline[4]. > [1] http://pastie.textmate.org/private/iaa1yopoarelylyfxfsmtw > [2] http://github.com/luislavena/rake-compiler/tree/master > [3] http://github.com/oneclick/rubyinstaller/ > [4]?http://121.78.227.9/rbreadline > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >