Ruby 1.8.1 on OS X Panther and RubyCocoa

Discussion in 'Ruby' started by Phil Tomson, Mar 4, 2004.

  1. Phil Tomson

    Phil Tomson Guest

    Being new to OS X (about 2 weeks now).

    What's the best way to upgrade from the included Ruby (1.6.8) to
    1.8.1?

    A couple of other questions:

    1. I want to use RubyCocoa; are there any issues if I upgrade to
    1.8.1?
    2. In the future it would be cool to be able to release my RubyCocoa
    creations into the OS X wild (even to non-Ruby users). Is there any
    way currently to package a RubyCocoa app so that anyone who downloads
    it can just run it without having to go and get the RubyCocoa libs?

    I guess it would be nice if Apple included RubyCocoa libs with their
    next release of OS X, that would make #2 easy. It seems like there
    are a couple of ways to achieve this:
    1) We include RubyCocoa in the standard Ruby release (of course it
    wouldn't get compiled on Windows platforms, but it could potentially
    work with GNUStep on Linux) as another GUI lib (like we include FOX
    and TK support now).
    2) We lobby Apple to include RubyCocoa in OS X 10.4

    #1 pros: we as a community have more control over it and it allows
    people to (potentially) create Cocoa apps that run on both OS X and
    Linux (GNUStep) platforms. Of course, I suspect the full API isn't
    available on Linux (like the AddressBook API for example). However,
    #1 would also add a lot of code to the standard Ruby distribution that
    would primarily benefit only one platform, so it may not be a good
    option.

    Pehaps there is another option:
    3) Those of us in the Ruby community who use OS X (seems to be a
    growing number) create a distribution of Ruby for OS X that includes
    RubyCocoa and try to get Apple to include it in 10.4. This would be
    kind of like the Windows version of Ruby.

    It's great to have Ruby included on OS X, but it would be even better
    if we could write Cocoa apps with it right out of the box. Is anyone
    at Apple listening?

    Phil
    Phil Tomson, Mar 4, 2004
    #1
    1. Advertising

  2. On Mar 4, 2004, at 1:49 PM, Phil Tomson wrote:
    > What's the best way to upgrade from the included Ruby (1.6.8) to
    > 1.8.1?


    Personally, I downloaded the source, built it, let it install in the
    standard location (/usr/local/) and added that to my path.

    I think I also hunted down old copies and deleted them from their
    standard-install locations.

    Dunno, though...what are your parameters for 'best'?

    I also trashed the built-in apache and built my own (again in the
    standard dir) along with postgresql and mod_ruby and eruby and
    ruby/postgres and more. The non-best aspect of this was that the
    Sharing pane in System Preferences no longer allows me to start/stop
    apache. The upside is that just about everything installed fine without
    having to point out specific directories.
    --
    (-, /\ \/ / /\/
    Gavin Kistner, Mar 4, 2004
    #2
    1. Advertising

  3. Phil Tomson

    Mark Hubbart Guest

    On Mar 4, 2004, at 12:49 PM, Phil Tomson wrote:

    > Being new to OS X (about 2 weeks now).
    >
    > What's the best way to upgrade from the included Ruby (1.6.8) to
    > 1.8.1?


    I tried a few different ways; for me the best way was to configure ruby
    to install into /usr/local. This lets me keep the system version of
    ruby around, and makes it so that I don't have to reinstall the newer
    version of ruby when I upgrade the OS.

    > 1. I want to use RubyCocoa; are there any issues if I upgrade to
    > 1.8.1?


    (Disclaimer! I didn't work with it a whole lot, but did read the docs.)
    IIRC: applications built with Ruby v1.8 may not run properly on systems
    running Ruby v1.6.

    > 2. In the future it would be cool to be able to release my RubyCocoa
    > creations into the OS X wild (even to non-Ruby users). Is there any
    > way currently to package a RubyCocoa app so that anyone who downloads
    > it can just run it without having to go and get the RubyCocoa libs?


    There are two types of applications that you can make with RubyCocoa.
    One is a standard ruby script that includes the extensions that link to
    the framework. The other is a bundled app that you produce using
    Apple's XCode. If you go with the bundled app, the framework can be
    bundled up inside the app and noone will need to know that you even
    used Ruby in the app :) If you distribute a script, OTOH, you will need
    to provide the framework and compiled extensions.

    > I guess it would be nice if Apple included RubyCocoa libs with their
    > next release of OS X, that would make #2 easy. It seems like there
    > are a couple of ways to achieve this:
    > 1) We include RubyCocoa in the standard Ruby release (of course it
    > wouldn't get compiled on Windows platforms, but it could potentially
    > work with GNUStep on Linux) as another GUI lib (like we include FOX
    > and TK support now).
    > 2) We lobby Apple to include RubyCocoa in OS X 10.4


    Personally, I really, REALLY think that Apple should maintain it. I
    think all the bridge projects are open-sourced, so they could make
    their own version of it. If they made RubyCocoa and it's sisters
    (CamelBones and PyObjC) as easy to use as the Java-ObjectiveC Bridge, I
    think there would be a lot more mac developers :) Seeing how many apps
    there are now that were written using the java bridge, I'm sure that a
    really good interface to the major "scripting" languages would result
    in tons of new or ported apps. I know I would be developing more.

    Unfortunately, Apple isn't maintaining them, and RubyCocoa, which was
    written by a very busy person, hasn't had any major updates in a while
    (that I know of) and last time I tried to install it (on panther) i
    found it to be too much trouble. If I knew ObjectiveC, I would try to
    help the project; but I don't.

    > It's great to have Ruby included on OS X, but it would be even better
    > if we could write Cocoa apps with it right out of the box. Is anyone
    > at Apple listening?


    I hope so... :)

    --Mark

    >
    > Phil
    >
    Mark Hubbart, Mar 4, 2004
    #3
  4. Phil Tomson

    Mark Hubbart Guest

    On Mar 4, 2004, at 1:30 PM, Gavin Kistner wrote:

    > On Mar 4, 2004, at 1:49 PM, Phil Tomson wrote:
    >> What's the best way to upgrade from the included Ruby (1.6.8) to
    >> 1.8.1?

    >
    > Personally, I downloaded the source, built it, let it install in the
    > standard location (/usr/local/) and added that to my path.
    >
    > I think I also hunted down old copies and deleted them from their
    > standard-install locations.
    >
    > Dunno, though...what are your parameters for 'best'?
    >
    > I also trashed the built-in apache and built my own (again in the
    > standard dir) along with postgresql and mod_ruby and eruby and
    > ruby/postgres and more. The non-best aspect of this was that the
    > Sharing pane in System Preferences no longer allows me to start/stop
    > apache.


    I believe you can solve this by editing the apache startup item to run
    your new apache. I did this when I was running fink's apache; just look
    in /System/Libray/StartupItems/Apache... there's a script in there.
    change the paths in it, and you *should* be good to go. You may have to
    change the $PATH environment variable too, though. Can't quite remember
    for sure.

    I wouldn't, though, trash the originals. when you update the system,
    they might just go right back in anyways, or worse, just parts of them.
    Also, you might want to be able to test something on the default setup,
    to make sure it'll run properly for Joe User, who doesn't know how to
    upgrade like that, and wouldn't want to anyhow. :)

    --Mark
    Mark Hubbart, Mar 4, 2004
    #4
  5. Phil Tomson

    Mark Wilson Guest

    On Mar 4, 2004, at 3:49 PM, Phil Tomson wrote:

    > Being new to OS X (about 2 weeks now).
    >
    > What's the best way to upgrade from the included Ruby (1.6.8) to
    > 1.8.1?
    >
    > A couple of other questions:
    >
    > 1. I want to use RubyCocoa; are there any issues if I upgrade to
    > 1.8.1?
    > 2. In the future it would be cool to be able to release my RubyCocoa
    > creations into the OS X wild (even to non-Ruby users). Is there any
    > way currently to package a RubyCocoa app so that anyone who downloads
    > it can just run it without having to go and get the RubyCocoa libs?
    >
    > [snip]


    DarwinPorts has a fair amount of Ruby stuff (including RubyCocoa).
    There's a fair amount there and, of course, a lot more that could be
    done (I myself don't have the competence or the time to contribute in
    the near future). Here's a link:

    http://darwinports.opendarwin.org/ports/?by=cat&substr=ruby

    Regards,

    Mark Wilson
    Mark Wilson, Mar 5, 2004
    #5
  6. Phil Tomson

    Phil Tomson Guest

    In article <>,
    Mark Hubbart <> wrote:
    >
    >On Mar 4, 2004, at 12:49 PM, Phil Tomson wrote:
    >
    >> Being new to OS X (about 2 weeks now).
    >>
    >> What's the best way to upgrade from the included Ruby (1.6.8) to
    >> 1.8.1?

    >
    >I tried a few different ways; for me the best way was to configure ruby
    >to install into /usr/local. This lets me keep the system version of
    >ruby around, and makes it so that I don't have to reinstall the newer
    >version of ruby when I upgrade the OS.
    >
    >> 1. I want to use RubyCocoa; are there any issues if I upgrade to
    >> 1.8.1?

    >
    >(Disclaimer! I didn't work with it a whole lot, but did read the docs.)
    >IIRC: applications built with Ruby v1.8 may not run properly on systems
    >running Ruby v1.6.


    I would expect that your RubyCocoa bindings would need to be built with
    the version of Ruby you're using - is that what you mean?

    >
    >> 2. In the future it would be cool to be able to release my RubyCocoa
    >> creations into the OS X wild (even to non-Ruby users). Is there any
    >> way currently to package a RubyCocoa app so that anyone who downloads
    >> it can just run it without having to go and get the RubyCocoa libs?

    >
    >There are two types of applications that you can make with RubyCocoa.
    >One is a standard ruby script that includes the extensions that link to
    >the framework. The other is a bundled app that you produce using
    >Apple's XCode. If you go with the bundled app, the framework can be
    >bundled up inside the app and noone will need to know that you even
    >used Ruby in the app :) If you distribute a script, OTOH, you will need
    >to provide the framework and compiled extensions.


    Can you give some more details about the second option? How does one go
    about doing this? (a quick HOWTO?)


    Phil
    Phil Tomson, Mar 5, 2004
    #6
  7. Phil Tomson

    Phil Tomson Guest

    In article <>,
    Mark Wilson <> wrote:
    >
    >On Mar 4, 2004, at 3:49 PM, Phil Tomson wrote:
    >
    >> Being new to OS X (about 2 weeks now).
    >>
    >> What's the best way to upgrade from the included Ruby (1.6.8) to
    >> 1.8.1?
    >>
    >> A couple of other questions:
    >>
    >> 1. I want to use RubyCocoa; are there any issues if I upgrade to
    >> 1.8.1?
    >> 2. In the future it would be cool to be able to release my RubyCocoa
    >> creations into the OS X wild (even to non-Ruby users). Is there any
    >> way currently to package a RubyCocoa app so that anyone who downloads
    >> it can just run it without having to go and get the RubyCocoa libs?
    >>
    >> [snip]

    >
    >DarwinPorts has a fair amount of Ruby stuff (including RubyCocoa).
    >There's a fair amount there and, of course, a lot more that could be
    >done (I myself don't have the competence or the time to contribute in
    >the near future). Here's a link:
    >
    >http://darwinports.opendarwin.org/ports/?by=cat&substr=ruby
    >


    Pardon my ignorance, but how does one use these ports?

    Phil
    Phil Tomson, Mar 5, 2004
    #7
  8. Phil Tomson

    Mark Hubbart Guest

    On Mar 4, 2004, at 9:09 PM, Phil Tomson wrote:

    > In article <>,
    > Mark Hubbart <> wrote:
    >>
    >> On Mar 4, 2004, at 12:49 PM, Phil Tomson wrote:
    >>
    >>> Being new to OS X (about 2 weeks now).
    >>>
    >>> What's the best way to upgrade from the included Ruby (1.6.8) to
    >>> 1.8.1?

    >>
    >> I tried a few different ways; for me the best way was to configure
    >> ruby
    >> to install into /usr/local. This lets me keep the system version of
    >> ruby around, and makes it so that I don't have to reinstall the newer
    >> version of ruby when I upgrade the OS.
    >>
    >>> 1. I want to use RubyCocoa; are there any issues if I upgrade to
    >>> 1.8.1?

    >>
    >> (Disclaimer! I didn't work with it a whole lot, but did read the
    >> docs.)
    >> IIRC: applications built with Ruby v1.8 may not run properly on
    >> systems
    >> running Ruby v1.6.

    >
    > I would expect that your RubyCocoa bindings would need to be built with
    > the version of Ruby you're using - is that what you mean?


    yeah. I'm nearly positive that if you build RubyCocoa against a certain
    version of Ruby, that's what you have to use with it from then on.
    That's one reason why I would advise against deleting the original
    distribution; that's the one that your users will have.

    >>> 2. In the future it would be cool to be able to release my RubyCocoa
    >>> creations into the OS X wild (even to non-Ruby users). Is there any
    >>> way currently to package a RubyCocoa app so that anyone who downloads
    >>> it can just run it without having to go and get the RubyCocoa libs?

    >>
    >> There are two types of applications that you can make with RubyCocoa.
    >> One is a standard ruby script that includes the extensions that link
    >> to
    >> the framework. The other is a bundled app that you produce using
    >> Apple's XCode. If you go with the bundled app, the framework can be
    >> bundled up inside the app and noone will need to know that you even
    >> used Ruby in the app :) If you distribute a script, OTOH, you will
    >> need
    >> to provide the framework and compiled extensions.

    >
    > Can you give some more details about the second option? How does one
    > go
    > about doing this? (a quick HOWTO?)


    There should be project templates (for Project Builder / XCode) that
    you can install with the framework... You build the app using XCode and
    Interface Builder, mostly like a Java-Cocoa app. Compile it in XCode,
    and it will build the application, and by default (I think) it includes
    the framework in the app bundle. The app that you get should look and
    act just like any other mac app.

    --Mark
    Mark Hubbart, Mar 5, 2004
    #8
  9. [courtesy cc of this posting sent to cited author via email]

    In article <>,
    Phil Tomson <> wrote:
    > Pardon my ignorance, but how does one use these ports?


    [about DarwinPorts]

    The best way is to get the tree with anonymous CVS as described on
    <http://darwinports.opendarwin.org/>, build the "port" command.

    Then installing a port is as easy as "port install ruby".
    --
    Ollivier ROBERT -=- EEC/AMI -=-
    Usenet Canal Historique FreeBSD: The Power to Serve!
    Ollivier Robert, Mar 6, 2004
    #9
    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. Jasper Dozer
    Replies:
    0
    Views:
    282
    Jasper Dozer
    Dec 15, 2003
  2. w chun
    Replies:
    1
    Views:
    303
    Russell E. Owen
    Mar 29, 2006
  3. Richard Kilmer

    Building Ruby 1.8.1 on Panther

    Richard Kilmer, Oct 27, 2003, in forum: Ruby
    Replies:
    2
    Views:
    93
    gabriele renzi
    Oct 28, 2003
  4. George Girton

    Ruby FTP broken in Panther?

    George Girton, Nov 17, 2003, in forum: Ruby
    Replies:
    0
    Views:
    102
    George Girton
    Nov 17, 2003
  5. jotto
    Replies:
    7
    Views:
    140
    Ryan Davis
    Jan 6, 2005
Loading...

Share This Page