How Do I Install Bash >= 3.2.25 on Mac Os X 10.5.8?

I'm following Michael Hartl's Rails tutorial, so far I've installed Git 1.7.5.4 x86_64 (I'm running OSX 10.5.8) and I'm trying to install rvm

After I run the following:

$ curl -kL get.rvm.io | bash -s stable

I get:

BASH 3.2.25 required (you have 3.2.17(1)-release)

I've tried changing the shell, using chsh -s /opt/local/bin/bash but I get shell '/opt/local/bin/bash' does not exist

Not sure where to go from here but I'd appreciate any guidance. Thanks!

4

5 Answers

Homebrew is generally a bit nicer than MacPorts, as it doesn't require lots of sudo action. Here's an article that guided me to upgrading my install of bash:

As for steps:

  1. Install Homebrew from the docs on their homepage
  2. Install Git using Homebrew (optional, but nice to have a more up-to-date git)

    brew install git
    
  3. Now install bash:

    brew install bash
    
  4. Add this install of bash to the allowed shells list:

    echo '/usr/local/bin/bash' | sudo tee -a /etc/shells;
    
    • Homebrew installs things to /usr/local/Cellar/ by default, then symlinks any binaries to /usr/local/bin, so you've now got the latest bash sitting at /usr/local/bin/bash
  5. Finally, change your shell to use this new one:

    chsh -s /usr/local/bin/bash
    
  6. Open a new terminal window/tab, and run these commands to double-check your work:

    $ echo $SHELL
    /usr/local/bin/bash
    $ echo $BASH_VERSION
    4.2.37(2)-release
    
4

mpapis' instructions are great, but didn't completely cover all the issues when I tried them, so this is what I had to do. Every time I install RVM on a legacy system it's a real trial. The below is far from perfect and it took almost an hour, but it got me Ruby 1.9.3 on 10.5.8.

The big picture (stuff that isn't always explained):

  1. RVM is designed to run under your user account, NOT as root with sudo, so these commands are to be entered without sudo, just as shown.
  2. Heeding mpapis' warning, I found that Ruby-1.9.3-p448 will work with gcc version 4.0.1 which comes with 10.5.8, but other Rubies may not.
  3. Some libraries Ruby requires initiate an install of MacPorts, e.g. if done like this: rvm pkg install zlib, but pkg has been deprecated, so enter rvm help autolibs to read more…
  4. …you may prefer something else to MacPorts, but after letting rvm pkg install zlib do its thing I gave in and later, my RVM install of Ruby used it nicely.
  5. Installing Ruby may take a very long time and appear to be doing nothing (you might see Installing required packages: autoconf, automake, [etc.] gdbm, ncurses........ followed by even more very slowly-appearing lines of ..........), but it will finish.
  6. During these processor-intensive installs your computer's fan will probably spin up to maximum speed for some time :-)
Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.