Ruby 1.9.3 and OS X Mountain Lion

Hi all,

I am using Ruby in an introductory computer science class in Highschool.
Of course, to keep things simple, I would like all my students to use
the same Ruby version (1.9.3p194).

At school we use W*****s machines and most of the students also use it
at home, but a few use Linux or OS X. Myself, I'm a convinced Linux user
so I do want to encourage my students to use a non-W*****s operating
system.

Problem is I have never used OS X and need some help from you
experienced users out there:

it seems that by default Ruby is already installed on OS X, but in
the wrong (for our purposes) version, 1.8.7. I think the student
who pointed that out to me uses Mountain Lion (maybe Lion).

What would be the least painful option, in your opinion:

- somehow uninstall the preinstalled version and install 1.9.3
   (I fear this could break the system, assuming Ruby is
    needed for some system tool(?) since it's already installed)

- install rvm

- ...?

- tolerate that students use different versions
   (this might mean higher effort for me when providing
    unit tests for programming tasks etc.)

Any hint is highly appreciated.

···

--
<https://github.com/stomar/>

Don't bother uninstalling. It'll just come back in updates.mapple leaves /usr/local completely alone, so edit /etc/paths to have /usr/local/bin first. Then, install Xcode via the AppStore so you can compile ruby and gems with c extensions. Then install Mac homebrew and use that to install ruby 1.9. Rvm is nice in certain contexts but really isn't necessary and overly complicates things.

···

On Sep 14, 2012, at 11:11, sto.mar@web.de wrote:

Hi all,

I am using Ruby in an introductory computer science class in Highschool.
Of course, to keep things simple, I would like all my students to use
the same Ruby version (1.9.3p194).

At school we use W*****s machines and most of the students also use it
at home, but a few use Linux or OS X. Myself, I'm a convinced Linux user
so I do want to encourage my students to use a non-W*****s operating
system.

Problem is I have never used OS X and need some help from you
experienced users out there:

it seems that by default Ruby is already installed on OS X, but in
the wrong (for our purposes) version, 1.8.7. I think the student
who pointed that out to me uses Mountain Lion (maybe Lion).

What would be the least painful option, in your opinion:

- somehow uninstall the preinstalled version and install 1.9.3
(I fear this could break the system, assuming Ruby is
  needed for some system tool(?) since it's already installed)

- install rvm

- ...?

- tolerate that students use different versions
(this might mean higher effort for me when providing
  unit tests for programming tasks etc.)

Any hint is highly appreciated.

--
<https://github.com/stomar/&gt;

As a Mac OS X user, and fairly novice Ruby scripter, I would recommend leaving
1.8 alone on the system. Simply have them install RVM, then use RVM to install
Ruby 1.9.3 and manage the Ruby version on the computer. This is the easiest way,
in my opinion, to install Ruby updates. In addition, if there is desire to
revert back, it's a simple switch in RVM.

Wayne

It happens that I just did this (install 1.9.3 on Snow Leopard and
Mountain Lion machines), and here's how:

http://www.apeth.com/nonblog/stories/ruby193.html

m.

···

<sto.mar@web.de> wrote:

What would be the least painful option, in your opinion:

--
matt neuburg, phd = matt@tidbits.com <http://www.tidbits.com/matt/&gt;
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
Matt Neuburg’s Home Page

Are all the various options free (as in "free beer")?
Ryan mentioned the AppStore.

I won't be able to report success or problems before a couple of days,
but thanks already for the many hints and suggestions.

Marcus

Again, thanks for all suggestions. Here a late update on this post:
I did not recommend it but the student absolutely wanted to try RVM.
Up to now it works fine without any problems.

···

Am 14.09.2012 20:11, schrieb sto.mar@web.de:

it seems that by default Ruby is already installed on OS X, but in
the wrong (for our purposes) version, 1.8.7. I think the student
who pointed that out to me uses Mountain Lion (maybe Lion).

What would be the least painful option, in your opinion:

--
<https://github.com/stomar/&gt;

Thanks Ryan and Wayne.

I slightly tend to avoiding rvm. I do use it, but I'm not sure whether it would be too complicated from the students' point of view.

@Ryan: How about gems in this setting? Would installation or usage of gems work without additional adjustments?

@Wayne: *Sounds* easy... how smooth is the installation?

···

Am 14.09.2012 20:17, schrieb Ryan Davis:

Don't bother uninstalling. It'll just come back in updates.mapple leaves /usr/local completely alone, so edit /etc/paths to have /usr/local/bin first. Then, install Xcode via the AppStore so you can compile ruby and gems with c extensions. Then install Mac homebrew and use that to install ruby 1.9. Rvm is nice in certain contexts but really isn't necessary and overly complicates things.

--
<https://github.com/stomar/&gt;

I disagree with this route. As you can see, homebrew makes things simpler for you:

  depends_on :autoconf if build.head?
  depends_on 'pkg-config' => :build
  depends_on 'readline'
  depends_on 'gdbm'
  depends_on 'libyaml'

boom. done. esp for a student... why should they bother with something more complex as well as error prone?

···

On Sep 14, 2012, at 16:20 , Matt Neuburg <matt@tidbits.com> wrote:

<sto.mar@web.de> wrote:

What would be the least painful option, in your opinion:

It happens that I just did this (install 1.9.3 on Snow Leopard and
Mountain Lion machines), and here's how:

How I Installed Ruby 1.9.3

yes, xcode is free. everything mentioned (iirc) is free.

···

On Sep 16, 2012, at 13:00 , stomar <sto.mar@web.de> wrote:

Are all the various options free (as in "free beer")?
Ryan mentioned the AppStore.

Using OSX Mountain Lion, used brew install to get latest ruby, the
deleted /usr/bin/ruby and symlinked the new one into there.

No problems thus far.

···

On Sat, Oct 13, 2012 at 6:59 PM, <sto.mar@web.de> wrote:

Am 14.09.2012 20:11, schrieb sto.mar@web.de:

it seems that by default Ruby is already installed on OS X, but in
the wrong (for our purposes) version, 1.8.7. I think the student
who pointed that out to me uses Mountain Lion (maybe Lion).

What would be the least painful option, in your opinion:

Again, thanks for all suggestions. Here a late update on this post:
I did not recommend it but the student absolutely wanted to try RVM.
Up to now it works fine without any problems.

--
<https://github.com/stomar/&gt;

yup... it should just work. I recommend `gem update --system`, but that's not strictly necessary. 1.9 ships with rubygems and homebrew (unlike many linux distros) doesn't cripple it. The other nice thing is that going the homebrew route opens up a lot of other things to the student (easy access to databases, editors, etc).

···

On Sep 14, 2012, at 12:00 , sto.mar@web.de wrote:

@Ryan: How about gems in this setting? Would installation or usage of gems work without additional adjustments?

Does a homebrew install put gems into /usr/local? And do you still have to muck with your PATH? I can't remember. If 'yes' and 'no' then homebrew is definitely the way to go I think. Anything else brings RVM back into consideration.

RVM is the alternative route, but RVM can be crazy making. Homebrew and RVM are not mutually compatible. A lot of the complexity of RVM can be made manageable by http://unfiniti.com/software/mac/jewelrybox which I'm using myself these days (which is why I can't answer my own question about the homebrew installation).

Cheers,
Bob

···

On 2012-09-14, at 8:48 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:

On Sep 14, 2012, at 16:20 , Matt Neuburg <matt@tidbits.com> wrote:

<sto.mar@web.de> wrote:

What would be the least painful option, in your opinion:

It happens that I just did this (install 1.9.3 on Snow Leopard and
Mountain Lion machines), and here's how:

How I Installed Ruby 1.9.3

I disagree with this route. As you can see, homebrew makes things simpler for you:

depends_on :autoconf if build.head?
depends_on 'pkg-config' => :build
depends_on 'readline'
depends_on 'gdbm'
depends_on 'libyaml'

boom. done. esp for a student... why should they bother with something more complex as well as error prone?

I see no error prone-ness. I've now done this on four different Mac OS X
installations using representing three different systems. I can do it
reliably with my eyes closed. m.

···

Ryan Davis <ryand-ruby@zenspider.com> wrote:

On Sep 14, 2012, at 16:20 , Matt Neuburg <matt@tidbits.com> wrote:

> <sto.mar@web.de> wrote:
>
>> What would be the least painful option, in your opinion:
>
> It happens that I just did this (install 1.9.3 on Snow Leopard and
> Mountain Lion machines), and here's how:
>
> How I Installed Ruby 1.9.3

I disagree with this route. As you can see,
homebrew makes things simpler for you:

  depends_on :autoconf if build.head?
  depends_on 'pkg-config' => :build
  depends_on 'readline'
  depends_on 'gdbm'
  depends_on 'libyaml'

boom. done. esp for a student... why should they bother with
something more complex as well as error prone?

--
matt neuburg, phd = matt@tidbits.com <http://www.tidbits.com/matt/&gt;
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
Matt Neuburg’s Home Page

Jos

···

On Fri, Sep 14, 2012 at 12:49 PM, Ryan Davis <ryand-ruby@zenspider.com>wrote:

On Sep 14, 2012, at 12:00 , sto.mar@web.de wrote:

> @Ryan: How about gems in this setting? Would installation or usage of
gems work without additional adjustments?

yup... it should just work. I recommend `gem update --system`, but that's
not strictly necessary. 1.9 ships with rubygems and homebrew (unlike many
linux distros) doesn't cripple it. The other nice thing is that going the
homebrew route opens up a lot of other things to the student (easy access
to databases, editors, etc).

Fwiw, I have homebrew working on my Mac and it works well.

--
Jos Backus
jos at catnook.com

Actually the rbenv way is even more boom-done. Once he's done the
installation once on his machine, the .rbenv folder is totally
self-contained. Ruby 1.9.3 is in it, and ready to run. So he has to do
is zip it up, put it where his students can download it, and say
"download this, unzip it in your Home folder, and name the unzipped
folder .rbenv." No muss, no fuss.

m.

···

Matt Neuburg <matt@tidbits.com> wrote:

Ryan Davis <ryand-ruby@zenspider.com> wrote:

> boom. done. esp for a student...

--
matt neuburg, phd = matt@tidbits.com <http://www.tidbits.com/matt/&gt;
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
Matt Neuburg’s Home Page

Bob Hutchison wrote in post #1076145:

Does a homebrew install put gems into /usr/local? And do you still have
to muck with your PATH?

Homebrew installs stuff under /usr/local/Cellar/<pkg>/<version>/ and
then installs symlinks into /usr/local/bin/ for the binaries, so you
don't have to muck about with PATH.

As for gems, the formula contains the following:

    # Put gem, site and vendor folders in the HOMEBREW_PREFIX
    ruby_lib = HOMEBREW_PREFIX/"lib/ruby"
    (ruby_lib/'site_ruby').mkpath
    (ruby_lib/'vendor_ruby').mkpath
    (ruby_lib/'gems').mkpath

    (lib/'ruby').install_symlink ruby_lib/'site_ruby',
                                 ruby_lib/'vendor_ruby',
                                 ruby_lib/'gems'

(where HOMEBREW_PREFIX defaults to /usr/local, I believe). That is, I
believe /usr/local/lib/ruby/gems will be symlinked into the correct
place. However I haven't actually installed ruby 1.9 on my Mac, as I
only use 1.8.

···

On 2012-09-14, at 8:48 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:

--
Posted via http://www.ruby-forum.com/\.