Ruby 1.8.1 on OS X Panther and RubyCocoa

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

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.

···

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?


(-, /\ / / //

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.

  1. 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 :slight_smile: 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 :slight_smile: 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… :slight_smile:

–Mark

···

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

Phil

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

···

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]

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’m using darwinports (http://www.darwinports.com/), so I just had to do
a sudo port install ruby, and made sure /opt/local/bin was first in my
$PATH. Darwinports also has a package for ruby-cocoa, but I didn’t test
it. (kinda new to ruby myself, using it since the fosdem ruby tutorial/talk)

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. :slight_smile:

–Mark

···

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.

In article C8AA3C9E-6E24-11D8-A7C0-000502FDD5CC@mac.com,

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?

  1. 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 :slight_smile: 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

···

Mark Hubbart discord@mac.com wrote:

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

In article 579C3E55-6E52-11D8-80C6-000393876156@cox.net,

···

Mark Wilson mwilson13@cox.net 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

In article C8AA3C9E-6E24-11D8-A7C0-000502FDD5CC@mac.com,

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.

  1. 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 :slight_smile: 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

···

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

Mark Hubbart discord@mac.com wrote:

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

[courtesy cc of this posting sent to cited author via email]

In article c291r511v3v@enews1.newsguy.com,

···

Phil Tomson ptkwt@aracnet.com 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 -=- ollivier.robert@eurocontrol.int
Usenet Canal Historique FreeBSD: The Power to Serve!