Read my latest article: Lesson Learned: Git Ref Naming (posted Fri, 19 Sep 2008 04:23:00 GMT)

Ruby 1.8.7 on MacPorts causing some problems

Posted by Robby Russell Fri, 20 Jun 2008 21:11:00 GMT

11 comments Latest by gourmet food Fri, 03 Oct 2008 16:31:26 GMT

It appears that MacPorts has upgraded to Ruby 1.8.7, which is good news if you’re running Rails 2.1… but if you have an older Rails application… it’s not going to work too well.

In order to get Ruby 1.8.6 installed with the latest MacPorts, you’ll need to do the following.


  $ mkdir /Users/Shared/dports

$ svn checkout -r 36429 \ 
    http://svn.macports.org/repository/macports/trunk/dports/lang/ruby/ \ 
    /Users/Shared/dports/lang/ruby/

Then you’ll need to modify your macports to use this new local source. You’ll need to edit /opt/local/etc/macports/sources.conf and add the following line above the existing rsync record.

file:///Users/Shared/dports and create that directory

Next, you’ll want to index this new local source with the following command:

portindex /Users/Shared/dports

After that, you can do the following.

sudo port uninstall rb-rubygems ruby

sudo port clean rb-rubygems ruby

sudo rm -r /opt/local/lib/ruby/gems/1.8/doc/rubygems-1.1.1/

sudo port deactivate autoconf

sudo port install ruby rb-rubygems

..and hopefully you’ll have Ruby 1.8.6 installed and be able to retain the rubygems you installed already.

Subscribe to my RSS feed Enjoying the content? Be sure to subscribe to my RSS feed.
Comments

Leave a response

  1. Avatar
    david Sat, 21 Jun 2008 06:58:49 GMT

    I dealt with the same problem on debian. Here is my little how to for debian users:

    http://dev.hubiquity.fr/2008/6/3/avoid-rails-troubles-with-ruby-1-8-7-under-debian

    david

  2. Avatar
    Evan Sun, 22 Jun 2008 20:43:46 GMT

    Use this Portfile http://pastie.org/220010 to get Ruby 1.8.6-p230.

  3. Avatar
    Preston Lee Fri, 27 Jun 2008 20:01:39 GMT

    Thanks for the note. We have some small Rails 2.0.x projects which seem to be working fine on Ruby 1.8.7, but there’s definitely some bustedness going on with TestUnit. Exceptions… everywhere :(

  4. Avatar
    Ric Tue, 01 Jul 2008 19:22:49 GMT

    Thanks. I ended up giving up on Macports due to the problems with Ruby 1.8.7.

    Btw, Robby, is something up with your feed? In Newsfire (my RSS reader), I get nothing, and sometimes when I go to your feed url, no posts are shown.

  5. Avatar
    Hodinky Tue, 15 Jul 2008 10:31:40 GMT

    I ended up too, thank you!

  6. Avatar
    2tamad Tue, 22 Jul 2008 00:38:09 GMT

    me too

  7. Avatar
    roop Sat, 26 Jul 2008 07:05:07 GMT

    Fantastic—these instructions worked like a charm.

  8. Avatar
    The Copyrighter Wed, 20 Aug 2008 03:06:59 GMT
  9. Avatar
    Chip Castle Tue, 16 Sep 2008 20:07:36 GMT

    This is exactly what I am looking for today, but I am running into a fetch problem on OS X 10.4.11:

    chip-castles-powerbook-g4-17:/opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/ruby deploy$ sudo port install rb-rubygems ruby -> Fetching ruby -> Attempting to fetch ruby-1.8.6-p114.tar.gz from http://www.ibiblio.org/pub/languages/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from http://mirrors.sunsite.dk/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://xyz.lcs.mit.edu/pub/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://ftp.iij.ad.jp/pub/lang/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://ftp.ruby-lang.org/pub/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://ftp.fu-berlin.de/unix/languages/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://ftp.easynet.be/ruby/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://ftp.ntua.gr/pub/lang/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://ftp.chg.ru/pub/lang/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://ftp.kr.FreeBSD.org/pub/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from ftp://ftp.iDaemons.org/pub/mirror/ftp.ruby-lang.org/ruby/1.8 -> Attempting to fetch ruby-1.8.6-p114.tar.gz from http://svn.macports.org/repository/macports/distfiles/ruby -> Attempting to fetch ruby-1.8.6-p114.tar.gz from http://svn.macports.org/repository/macports/distfiles/general/ -> Attempting to fetch ruby-1.8.6-p114.tar.gz from http://svn.macports.org/repository/macports/downloads/ruby Error: Target org.macports.fetch returned: fetch failed Error: The following dependencies failed to build: ruby Error: Status 1 encountered during processing.

    Any suggestions for fixing this fetch issue?

    Thanks!

  10. Avatar
    gourmet food Fri, 03 Oct 2008 16:06:59 GMT
    not sure it works here… it gives me the following warning:
    Warning: /opt/local/etc/macports/sources.conf specifies invalid source 'file:///Users/Shared/dports and create that directory', ignored.
    
    just started it with the following command:
     sudo port install ruby@1.8.6-p114 rb-rubygems rb-termios rb-mysql swig
    

    because without the @ it tried to install 1.8.7 anyway

  11. Avatar
    gourmet food Fri, 03 Oct 2008 16:31:26 GMT

    I did not work in the end. But I know why: not enough coffee!

    I copied all the line “file:///Users/Shared/dports and create that directory”

    You should at a line break to your instructions my friend.

    sudo port install ruby  rb-rubygems rb-termios rb-mysql swig
    --->  Fetching ruby
    --->  Attempting to fetch ruby-1.8.6-p114.tar.gz from http://www.ibiblio.org/pub/languages/ruby/1.8
    [...]
    

    thanks!

Share your thoughts... (really...I want to hear them)

Comments