Accidental Technologist

Musings about Entrepreneurship, Technology and Software Development

  • Home
  • About
  • Still River Software
  • Privacy Policy

Powered by Genesis

You are here: Home / Ruby / Building Ruby 1.9.0 on an Apple Mac

Building Ruby 1.9.0 on an Apple Mac

December 31, 2007 by Rob Bazinet

Tweet

I decided to start playing around with the latest Ruby, 1.9.0, which was released on Christmas Day.  I am on a MacBook Pro running OSX Tiger 10.4.11.

I previously blogged about what to do with Ruby 1.9 to get up-to-speed. Anyone using Ruby today probably shouldn’t be considering overwriting their Ruby 1.8.6 installation if they do any real coding or have an existing code base. Many of the gems and libraries you use may not work with 1.9, Rails 2.0.2 for one does not.

Getting Started

The first thing I did was download the Ruby 1.9 source from Ruby-Lang, ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.0-0.tar.gz. I copied the contents of this archive to a folder in my home directory called Source (/Users/rbazinet/Source). This way I keep all of my downloaded source organized and easy to manage.

Opening up a Terminal window and changing to that directory will get things started. Now to setup the build to not overwrite my installed version 1.8.6 of Ruby, I created a directory called ruby19 in my home directory.

$ autoconf $ ./configure --prefix=/Users/rbazinet/ruby19 $ make

Of course nothing always works as planned. During the build I received the following error:

compiling readlinegcc -I. -I../../.ext/include/i686-darwin8.11.1 -I../.././include -I../.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -fno-common -g -O2 -pipe -fno-common -o readline.o -c readline.c readline.c: In function 'filename_completion_proc_call': readline.c:659: error: 'filename_completion_function' undeclared (first use in this function) readline.c:659: error: (Each undeclared identifier is reported only once readline.c:659: error: for each function it appears in.) readline.c:659: warning: assignment makes pointer from integer without a cast readline.c: In function 'username_completion_proc_call': readline.c:684: error: 'username_completion_function' undeclared (first use in this function) readline.c:684: warning: assignment makes pointer from integer without a cast make[1]: *** [readline.o] Error 1 make: *** [all] Error 1

It appears readline is the problem here and needs to be updated. After a bit of searching around the net I can across some information about this and determine readline needs to be updated to readline 5.2.

Readline can be downloaded from Gnu.org. I created a directory in my standard Source folder called readline-5.2 and then performed a build:

$ cd /User/rbazinet/Source/readline-5.2 $ ./configure --prefix=/usr/local $ make $ sudo make install

Now with Readline 5.2 installed I tried the Ruby 1.9 build again, this time indicating the location of my new Readline installation:

$ autoconf $ ./configure --prefix=/Users/rbazinet/ruby19 --with-readline-dir=/usr/local $ make $ make install

Changing to our new Ruby 1.9 installation directory:

$ cd /Users/rbazinet/ruby19/bin $ ./ruby -v ruby 1.9.0 (2007-12-25 revision 14709) [i686-darwin8.11.1] $ 

Success!

We could add our new ruby/bin to path if we wanted, to make it a big easier to test, but for now this works.  I am running Tiger so I don’t know if this same procedure works on Leopard.  If someone can confirm if this works or can comment on how to build Ruby 1.9 on Leopard, I will update this post to reflect what is needed to be done.

Technorati Tags: Ruby,Apple Mac,OSX

Share this:

  • LinkedIn
  • Twitter
  • Facebook
  • Email
  • More
  • Pinterest
  • Tumblr
  • Pocket
  • Reddit

Related

Filed Under: Ruby

Care about your privacy? I do and use Fathom Analytics on this site.

Fathom Analytics

Comments

  1. yudi says

    January 2, 2008 at 8:06 pm

    Glad you have no problem on tiger, there are too many problems building readline on leopard and ruby as well.

    I’m counting on apple to release a new security update that has ruby 1.9 as well.

    Also you might want to add –program-suffix=1.9 behind ./condigure, as lots of people using ruby on rails, the fast thread is not yet working with ruby 1.9

  2. yudi says

    January 2, 2008 at 8:06 pm

    Glad you have no problem on tiger, there are too many problems building readline on leopard and ruby as well.
    I’m counting on apple to release a new security update that has ruby 1.9 as well.
    Also you might want to add –program-suffix=1.9 behind ./condigure, as lots of people using ruby on rails, the fast thread is not yet working with ruby 1.9

  3. Rob Bazinet says

    January 3, 2008 at 10:07 am

    @Yudi thanks for the info. It was a bit of challenge on Tiger but not bad. I hear Ruby 1.9 just does not work on Leopard yet.

    What exactly does the -program-suffix=1.9 do exactly? Is this strictly for fastthread?

  4. Rob Bazinet says

    January 3, 2008 at 10:07 am

    @Yudi thanks for the info. It was a bit of challenge on Tiger but not bad. I hear Ruby 1.9 just does not work on Leopard yet.
    What exactly does the -program-suffix=1.9 do exactly? Is this strictly for fastthread?

  5. Claude Crider says

    January 8, 2008 at 4:07 pm

    I’m having a problem with readline (5.2 and 5.1) on Ruby 1.8 that seems similar to this. I get the following error and two different scenarios:

    dyld: NSLinkModule() error

    dyld: Symbol not found: _rl_filename_completion_function

    Referenced from: /usr/local/lib/ruby/1.8/powerpc-darwin8.11.0/readline.bundle

    Expected in: flat namespace

    I’m using OSX 10.4.11. I tried installing readline 5.2 with the configure options above and it made no difference.

    Any ideas?

  6. Claude Crider says

    January 8, 2008 at 4:07 pm

    I’m having a problem with readline (5.2 and 5.1) on Ruby 1.8 that seems similar to this. I get the following error and two different scenarios:
    dyld: NSLinkModule() error
    dyld: Symbol not found: _rl_filename_completion_function
    Referenced from: /usr/local/lib/ruby/1.8/powerpc-darwin8.11.0/readline.bundle
    Expected in: flat namespace
    I’m using OSX 10.4.11. I tried installing readline 5.2 with the configure options above and it made no difference.
    Any ideas?

  7. Rob Bazinet says

    January 8, 2008 at 11:24 pm

    @Claude Are you getting the error when building Readline or after when you try to build Ruby 1.9? I have seen some special cases on the web when building Readline on a PowerPC Mac. I assume this is what you are using?

  8. Rob Bazinet says

    January 8, 2008 at 11:24 pm

    @Claude Are you getting the error when building Readline or after when you try to build Ruby 1.9? I have seen some special cases on the web when building Readline on a PowerPC Mac. I assume this is what you are using?

  9. Claude Crider says

    January 9, 2008 at 9:49 am

    Hey thanks for the help. I really appreciate it.

    I’m having no trouble on the build. I basically followed the directions for the build that are at hivelogic.com/…/ruby_rails_ligh

    and that went fine as far as I could tell.

    When installing both Ruby and Readline, at the ./configure step, I used the ‘–with-readline-dir=/usr/local’ parameter

    Current installed versions on my machine are:

    Ruby 1.8.4 (2005-12-24) [powerpc-darwin8.11.0]

    Rails 1.2.5

    LightTPD 1.4.18

    MySQL 5.0.45-OSX10.4-powerpc-64bit

    FastCGI 2.4.0

    RubyGems 0.9.0

    Readline 5.2

    PCRE 6.6

    I get this error in two different scenarios:

    1) whenever I type irb from a command prompt

    2) when doing the exercise on p. 39 of the Prag Prog book Agile Web Development with Rails. When I point the browser to localhost/…/hello the error message appears in the terminal window and the browser then hangs.

    Thanks again!!

  10. Claude Crider says

    January 9, 2008 at 9:49 am

    Hey thanks for the help. I really appreciate it.
    I’m having no trouble on the build. I basically followed the directions for the build that are at hivelogic.com/…/ruby_rails_ligh
    and that went fine as far as I could tell.
    When installing both Ruby and Readline, at the ./configure step, I used the ‘–with-readline-dir=/usr/local’ parameter
    Current installed versions on my machine are:
    Ruby 1.8.4 (2005-12-24) [powerpc-darwin8.11.0]
    Rails 1.2.5
    LightTPD 1.4.18
    MySQL 5.0.45-OSX10.4-powerpc-64bit
    FastCGI 2.4.0
    RubyGems 0.9.0
    Readline 5.2
    PCRE 6.6
    I get this error in two different scenarios:
    1) whenever I type irb from a command prompt
    2) when doing the exercise on p. 39 of the Prag Prog book Agile Web Development with Rails. When I point the browser to localhost/…/hello the error message appears in the terminal window and the browser then hangs.
    Thanks again!!

  11. Claude Crider says

    January 9, 2008 at 12:33 pm

    Looks like I fixed this problem. I found a discussion topic at ruby-forum.com that pertained to this issue.

    Specifically: http://www.ruby-forum.com/…/49800

    It appears that the trick was this: After installing, rebuilding Readline 5.2 in place of 5.1, then rebuild Ruby. But in the Ruby directory do a ‘make distclean’ prior to the configure, make, sudo make install steps.

    The ‘make distclean’ was the trick. I have no idea what that does, but that appears to be what solved the problem, along with installing Readline 5.2 in place of 5.1.

    Sorry to be such a bother, and thanks so much for your attention.

  12. Claude Crider says

    January 9, 2008 at 12:33 pm

    Looks like I fixed this problem. I found a discussion topic at ruby-forum.com that pertained to this issue.
    Specifically: http://www.ruby-forum.com/…/49800
    It appears that the trick was this: After installing, rebuilding Readline 5.2 in place of 5.1, then rebuild Ruby. But in the Ruby directory do a ‘make distclean’ prior to the configure, make, sudo make install steps.
    The ‘make distclean’ was the trick. I have no idea what that does, but that appears to be what solved the problem, along with installing Readline 5.2 in place of 5.1.
    Sorry to be such a bother, and thanks so much for your attention.

  13. Rob Bazinet says

    January 9, 2008 at 12:44 pm

    @Claude Great news! You were no bother at all, this is what blogging and commenting is all about, collaborating.

    I thank you for following up and letting me know how you fixed it. I wondered if maybe a clean configure might do the trick. So the “make distclean” does that extra step. A new one for me too.

  14. Rob Bazinet says

    January 9, 2008 at 12:44 pm

    @Claude Great news! You were no bother at all, this is what blogging and commenting is all about, collaborating.
    I thank you for following up and letting me know how you fixed it. I wondered if maybe a clean configure might do the trick. So the “make distclean” does that extra step. A new one for me too.

Recent Posts

  • How to Fix Rails Flash Rendering When Using Hotwire
  • Hotwire Fix for CORS Error when using Omniauth
  • Fix Installation of Ruby using rbenv on macOS Big Sur
  • RailsConf 2021 and the Future of Conferences
  • Fixing Out of Diskspace Errors on Amazon EC2

Categories

Services I Love

HatchBox - Easy Rails Deploys Fathom Analytics
Follow @rbazinet

Rob Bazinet (ruby.social/@rbazinet)
@rbazinet

  • Working to wrap up my current consulting gig by mid-April. I will be looking for the next thing soon. If anyone has… https://t.co/sg3cSV9yqM
    about 3 hours ago
  • I’ve been spending some time using Notion AI lately and it surprisingly good. Since all the rage lately is ChatGPT,… https://t.co/cUXFWIRCVV
    about 3 days ago
  • I think these steps are true for any target audience. https://t.co/0ht6rIzOW3
    about 3 days ago
  • I’ve been enjoying a show from the Magnolia network called The Craftsman. It’s mainly about woodworking but his phi… https://t.co/sWTUBbSsl6
    about 3 days ago
  • I found the resource I was looking for last night that is similar to https://t.co/Pyn0IIjRdP, it is… https://t.co/U7TMe77FMF
    about 3 days ago
  • RSS - Posts
  • RSS - Comments
Find me on Mastodon