what Ruby version to use on Windows for a 1.2.x RoR app?

Discussion in 'Ruby' started by neongrau __, Feb 20, 2009.

  1. neongrau __

    neongrau __ Guest

    hi there!

    this might sound like a rant, but i'm just desperate :(

    i was running my app with ruby 1.8.5p52 for quite a while and the
    mongrel processes were quite memory stable as well as the dRB process
    for ferret.

    the latest security problem wasn't much of an issue since the app only
    runs in an intranet environment.

    i now tried 1.8.5p231 (the last stable i could find from the 1.8.5
    series) because of some supposedly fixed memory leak in "eval" which i
    need for a service to peridodically execute some tasks for my RoR app.

    e.g.
    1000.times {|i|eval("a#{i} = 1")}
    leaked memory like hell in 1.8.5p52
    while in 1.8.5p231 it seemed totally stable (at least for that snippet).

    so i updated the server with that 1.8.5p231 version.
    but sadly my service is still leaking memory. even worse: now all
    mongrels and the ferret service also leak memory like mad. (each mongrel
    eating 300+mb after just 12 hours).

    isn't there any memory stable ruby version for windows?

    or at least is there a way to reset a ruby process and make it start
    itself over? normally i'd be totally against such methods, but since
    ruby itself can't run stable i see no other way :(

    PS:
    upgrading to RoR 2.x or
    moving to Linux is out of the question (trust me, i would if i could)
    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Feb 20, 2009
    #1
    1. Advertising

  2. neongrau __

    Roger Pack Guest

    > isn't there any memory stable ruby version for windows?

    There almost is :)
    the mingw version is faster:
    http://www.akitaonrails.com/2008/7/26/still-playing-with-ruby-on-windows
    you can see if it doesn't leak.
    If it still does I could possibly build you a 187 with the MBARI patches
    for mingw. It might work [the MBARI patches helped me overcome a leak]
    :)
    -=r
    >
    > or at least is there a way to reset a ruby process and make it start
    > itself over? normally i'd be totally against such methods, but since
    > ruby itself can't run stable i see no other way :(
    >
    > PS:
    > upgrading to RoR 2.x or
    > moving to Linux is out of the question (trust me, i would if i could)


    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Feb 21, 2009
    #2
    1. Advertising

  3. neongrau __

    Roger Pack Guest

    Roger Pack, Feb 21, 2009
    #3
  4. neongrau __

    neongrau __ Guest

    Roger Pack wrote:
    >> isn't there any memory stable ruby version for windows?

    >
    > There almost is :)
    > the mingw version is faster:
    > http://www.akitaonrails.com/2008/7/26/still-playing-with-ruby-on-windows
    > you can see if it doesn't leak.
    > If it still does I could possibly build you a 187 with the MBARI patches
    > for mingw. It might work [the MBARI patches helped me overcome a leak]


    thanks alot for pointing that out!
    i didn't knew there were such ugly problems with ruby just because it
    was compiled with VC6. :S

    downloaded and installed it today. had to fix 1 or 2 minor glitches in
    the app to get it working with 1.8.6.

    still too early to say s.th. but looks promising so far.


    1.8.7 sadly doesn't work with rails 1.2.x. but out of interest...

    what are those MBARI patches? any link?


    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Feb 23, 2009
    #4
  5. neongrau __

    Roger Pack Guest

    Roger Pack, Feb 23, 2009
    #5
  6. neongrau __

    neongrau __ Guest

    Roger Pack wrote:
    >
    >> 1.8.7 sadly doesn't work with rails 1.2.x. but out of interest...
    >>
    >> what are those MBARI patches? any link?

    >
    > http://github.com/brentr/matzruby/tree/v1_8_7_72-mbari
    > Also I...think 1.8.7 works with rails 1.2.x
    > let me know if you ever need to try :)
    > -=r


    that sounds pretty interesting, it's just that i tried 1.8.7 2 weeks ago
    and it didn't work. i kept trying until i somewhere read that 1.8.7
    would only work with rails 2.x.

    but if you have a binary somewhere i'd give it a try. isn't there any
    1.8.6 version with those patches? (especially Patch 3 and 4 sounds
    good).

    so far the 1.8.6 i'm testing atm seems to be more stable than every
    version i ever had. sadly my service still seems to eat a few KB per
    hour. not as bad as before, but a leak of 15M per day is still not
    acceptable :(

    regards
    ralf

    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Feb 24, 2009
    #6
  7. neongrau __

    Roger Pack Guest

    neongrau __ wrote:
    > Roger Pack wrote:
    >>
    >>> 1.8.7 sadly doesn't work with rails 1.2.x. but out of interest...
    >>>
    >>> what are those MBARI patches? any link?

    >>
    >> http://github.com/brentr/matzruby/tree/v1_8_7_72-mbari
    >> Also I...think 1.8.7 works with rails 1.2.x
    >> let me know if you ever need to try :)
    >> -=r

    >
    > that sounds pretty interesting, it's just that i tried 1.8.7 2 weeks ago
    > and it didn't work. i kept trying until i somewhere read that 1.8.7
    > would only work with rails 2.x.
    >
    > but if you have a binary somewhere i'd give it a try. isn't there any
    > 1.8.6 version with those patches? (especially Patch 3 and 4 sounds
    > good).


    There's a branch that has 1.8.6 with the patches. I believe it's stable
    though it hasn't seen as much work as the 1.8.7 line.
    here's some refs:
    how to build mingw from scratch:
    http://github.com/oneclick/rubyinstaller/tree/master
    [run rake]
    http://github.com/brentr/matzruby/tree/v1_8_7_72-mbari
    look at the other branches.
    I may be able to come up with a binary.
    -=r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Feb 25, 2009
    #7
  8. neongrau __

    neongrau __ Guest

    Roger Pack wrote:
    > There's a branch that has 1.8.6 with the patches. I believe it's stable
    > though it hasn't seen as much work as the 1.8.7 line.
    > here's some refs:
    > how to build mingw from scratch:
    > http://github.com/oneclick/rubyinstaller/tree/master
    > [run rake]
    > http://github.com/brentr/matzruby/tree/v1_8_7_72-mbari
    > look at the other branches.
    > I may be able to come up with a binary.
    > -=r


    cool, guess i have to get git after all. (i'm still a SVN user)

    and don't have any compiler on my XP vmware installation yet.
    so i suppose i need to spent some time first to install everything
    before i can try that. PITA!

    i wonder if it would work to cross-compile from OSX.

    but i'll have some extra spare time next weeks anyway, so i now know how
    to spend it ;)

    ralf
    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Feb 26, 2009
    #8
  9. neongrau __

    Roger Pack Guest

    > and don't have any compiler on my XP vmware installation yet.
    > so i suppose i need to spent some time first to install everything
    > before i can try that. PITA!


    Thanksfully with the oneclick mingw installer you download it and run
    rake and it downloads the compiler for you, then uses it to build ruby
    :)

    > i wonder if it would work to cross-compile from OSX.


    http://github.com/luislavena/rake-compiler/tree/master
    is an attempt at a helper for cross compiling.

    my fork of rubyinstaller works for compiling 186p287 and 186 trunk.
    http://github.com/rogerdpack/rubyinstaller/tree/master

    You'll want to somehow merge that to brent's 186 branch:
    http://github.com/brentr/matzruby/tree/v1_8_6_287-mbari

    if I don't get to it first :)

    -=r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Feb 26, 2009
    #9
  10. neongrau __

    neongrau __ Guest

    i have no experience with git, i just did this:
    git clone git://github.com/oneclick/rubyinstaller.git

    cd rubyinstaller
    rake

    but the promise of just typing "rake" was too good to be true :(

    patching file `lib/webrick/httpservlet/filehandler.rb'
    Hunk #1 FAILED at 163.
    Hunk #2 succeeded at 216 with fuzz 2 (offset 17 lines).
    Hunk #3 FAILED at 290.
    Hunk #4 FAILED at 344.
    3 out of 4 hunks FAILED -- saving rejects to
    lib/webrick/httpservlet/filehandler
    rb.rej
    patching file `sprintf.c'
    patching file `string.c'
    rake aborted!
    Command failed with status (1):
    ["C:/tmp/git/rubyinstaller/sandbox/msys/bin...]

    guess i need some specific tag/branch/revision i don't know yet. have to
    dig into git and figure that out first.

    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Feb 27, 2009
    #10
  11. neongrau __

    Roger Pack Guest

    neongrau __ wrote:
    > i have no experience with git, i just did this:
    > git clone git://github.com/oneclick/rubyinstaller.git
    >
    > cd rubyinstaller
    > rake
    >
    > but the promise of just typing "rake" was too good to be true :(



    yeah the main git repo has some bugs currently.
    My fork fixes them :)
    http://github.com/rogerdpack/rubyinstaller/tree/master
    do rake -T to see how to use it.
    I'd also be interested to see if the CHECKOUT=1 MBARI=1 option works or
    not.
    Thanks!
    -=r


    > guess i need some specific tag/branch/revision i don't know yet. have to
    > dig into git and figure that out first.


    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Feb 27, 2009
    #11
  12. neongrau __

    neongrau __ Guest

    Roger Pack wrote:
    > I'd also be interested to see if the CHECKOUT=1 MBARI=1 option works or
    > not.


    ok, cool

    "rake CHECKOUT=1 MBARI=1"

    on your fork is currently running.
    let's wait and see :)

    cheers
    ralf
    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Feb 27, 2009
    #12
  13. neongrau __

    neongrau __ Guest

    yay! rake just finished :)

    couldn't see any errors, last output was a large textblock about
    rubygems-update.

    so how do i proceed to get a proper ruby directory out of it?
    i don't really want/need an installer msi.
    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Feb 27, 2009
    #13
  14. neongrau __

    Roger Pack Guest

    neongrau __ wrote:
    >
    > yay! rake just finished :)
    >
    > couldn't see any errors, last output was a large textblock about
    > rubygems-update.
    >
    > so how do i proceed to get a proper ruby directory out of it?
    > i don't really want/need an installer msi.


    Wow way to go. I started mine building yesterday and the internet is so
    slow at work that it hasn't finished downloading from github LOL.
    I'm not sure what to do after you build it--you could try rake package
    then install the generated package, or you could search for and run
    ruby.exe [which is what I typically do]. The only problem with that is
    that rubygems is installed in a "separate, side by side" folder, so if
    you want to run it from where it's built you'll need to either copy the
    rubygems folders' contents into the ruby_mingw directory, or reinstall
    rubygems.
    Let me know how it goes. Should it work you'll be the first person ever
    to have built and run the 1.8.6 MBARI patches on windows. :)

    -=r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Feb 27, 2009
    #14
  15. neongrau __

    neongrau __ Guest

    Roger Pack wrote:
    > Let me know how it goes. Should it work you'll be the first person ever
    > to have built and run the 1.8.6 MBARI patches on windows. :)


    that's what i have so far:

    C:\tmp\git\rubyinstaller\sandbox\ruby_test\bin>.\ruby.exe -v
    ruby 1.8.6 (2009-2-26 mbari 8A/0x8770 on patchlevel 287) [i386-mingw32]

    but no joy with rubygems yet

    C:\tmp\git\rubyinstaller\sandbox\ruby_test\bin>.\ruby.exe -e puts('Hello
    World!')
    \ruby.exe: no such file to load -- ubygems (LoadError)


    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Feb 27, 2009
    #15
  16. neongrau __

    Roger Pack Guest


    > but no joy with rubygems yet
    >
    > C:\tmp\git\rubyinstaller\sandbox\ruby_test\bin>.\ruby.exe -e puts('Hello
    > World!')
    > .\ruby.exe: no such file to load -- ubygems (LoadError)


    Yeah I'd probably download their .zip install file then ruby "ruby
    setup.rb" on them. Either that or somewhere there's something akin to a
    sandbox\rubygems folder that you have to copy "over" the ruby_test
    directory.
    GL.
    -=r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Feb 27, 2009
    #16
  17. neongrau __

    Roger Pack Guest

    neongrau __ wrote:
    > Roger Pack wrote:
    >> Let me know how it goes. Should it work you'll be the first person ever
    >> to have built and run the 1.8.6 MBARI patches on windows. :)



    Mine finally finished building :)
    I went ahead and published a few working installer copies of mingw ruby
    1.8.6 OCI at http://roger.doachristianturndaily.info/ruby/installs/

    ruby-186-p287-mbari.msi is the installer output of running rake
    CHECKOUT=1 MBARI=1

    and the mbari one does seem to be better with memory.

    The p355 is just a straight build from trunk [CHECKOUT=1] from today.
    Note that it isn't quite stable [1].

    Cheers!
    -=r
    [1] http://redmine.ruby-lang.org/issues/show/1223
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Feb 28, 2009
    #17
  18. neongrau __

    neongrau __ Guest

    Roger Pack wrote:
    > Mine finally finished building :)
    > I went ahead and published a few working installer copies of mingw ruby
    > 1.8.6 OCI at http://roger.doachristianturndaily.info/ruby/installs/


    hey!

    "You don't have permission to access
    /ruby/installs/ruby-186-p287-mbari.msi on this server."

    the file permissions seem to be wrong.
    but i've installed .NET3.5 now and was able to build the .msi
    installer(s) myself.

    some quick testing showed the following behavior:

    - initial memory load seems to be much higher than mswin32 builds
    "ruby script/console" uses around 70-75 MB while the mswin32 build
    just grabbed 40-42 MB.
    - installed gems don't seem to play nice with the mingw32 build. while i
    was able to install a compatible mongrel build, the mongrel_service gem
    seems not to be compatible at all.
    i can start mongrel on console via "ruby script/server -e production"
    but when trying to start as a service it just crashes and tries to start
    over and over and over...
    - memory consumption over time is hard to tell so far, but my guess is
    that it is marginally better than the official stable OCI build.
    --
    Posted via http://www.ruby-forum.com/.
     
    neongrau __, Mar 2, 2009
    #18
  19. neongrau __

    Roger Pack Guest

    neongrau __ wrote:
    > Roger Pack wrote:
    >> Mine finally finished building :)
    >> I went ahead and published a few working installer copies of mingw ruby
    >> 1.8.6 OCI at http://roger.doachristianturndaily.info/ruby/installs/

    >
    > hey!
    >
    > "You don't have permission to access
    > /ruby/installs/ruby-186-p287-mbari.msi on this server."


    k fixed those and uploaded a copy that has the devkit with it :)
    Sorry.


    > the file permissions seem to be wrong.
    > but i've installed .NET3.5 now and was able to build the .msi
    > installer(s) myself.
    >
    > some quick testing showed the following behavior:
    >
    > - initial memory load seems to be much higher than mswin32 builds
    > "ruby script/console" uses around 70-75 MB while the mswin32 build
    > just grabbed 40-42 MB.
    > - installed gems don't seem to play nice with the mingw32 build. while i
    > was able to install a compatible mongrel build, the mongrel_service gem
    > seems not to be compatible at all.


    yeah mingw is cutting edge so not all gems are yet compatible with it.
    It would be interesting to look into it and try and see why.

    I'm not sure why it would start with higher memory use. Make sure
    you're not using p355 which has a memory leak :)

    Does yours use 100% cpu when you are in script/console? [or irb, for
    that matter]?
    Thanks!
    -=r
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Mar 2, 2009
    #19
  20. neongrau __

    Roger Pack Guest

    > k fixed those and uploaded a copy that has the devkit with it :)

    Also note that I "nuked and rebuilt" my github/rubyinstaller
    repository[1] today, so that the commits would be cleaner, so git pull
    will be unreliable until reclone it.
    Also, if you get a stackdump with STATUS_ACCESS_VIOLATION using msysgit
    you need a newer copy of msys-1.0.dll [2]

    -=r
    [1] http://github.com/rogerdpack/rubyinstaller/tree/master
    [2]
    http://groups.google.com/group/msysgit/browse_thread/thread/df3f365d702d33df
    --
    Posted via http://www.ruby-forum.com/.
     
    Roger Pack, Mar 2, 2009
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. V Green
    Replies:
    0
    Views:
    862
    V Green
    Feb 5, 2008
  2. PA Bear [MS MVP]
    Replies:
    0
    Views:
    972
    PA Bear [MS MVP]
    Feb 5, 2008
  3. Martin Nemzow
    Replies:
    0
    Views:
    100
    Martin Nemzow
    Jun 1, 2006
  4. Recruitment Development

    [JOB] Ruby/Ruby on Rails(RoR) Developers in London

    Recruitment Development, Aug 6, 2007, in forum: Ruby
    Replies:
    0
    Views:
    119
    Recruitment Development
    Aug 6, 2007
  5. Hanina Rind

    RoR Help Authoring App

    Hanina Rind, Jun 23, 2008, in forum: Ruby
    Replies:
    0
    Views:
    97
    Hanina Rind
    Jun 23, 2008
Loading...

Share This Page