简体   繁体   中英

Installing Ruby On OSX Mavericks

I have recently upgraded my iMac OS to the most recent OSX Mavericks (10.9.3) and am unable to install ruby 1.9.3. I have run into proposed solution in the book. I have installed xCode, command line tools, fixed every warning and error using brew doctor until I got the "Your system is ready to brew" message, and several other methods proposed online. Any suggestions would help greatly. Below is the error I am getting when I use the command ruby install 1.9.3 as well as most other variations to this command. (This happens with every version of ruby as well, not just 1.9.3). No matter what I do, the EXACT same error occurs right after "openssl..........."


Installing required packages: readline, openssl...........
Error running 'requirements_osx_brew_libs_install readline openssl',
showing last 15 lines of /Users/julian/.rvm/log/1403049978_ruby-2.1.2/package_install_readline_openssl.log
++ /scripts/functions/logging : rvm_pretty_print()  81 > case "$1" in
++ /scripts/functions/logging : rvm_pretty_print()  82 > [[ -t 1 ]]
++ /scripts/functions/logging : rvm_pretty_print()  82 > return 1
++ /scripts/functions/logging : rvm_warn()  139 > printf %b 'There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/Homebrew/homebrew/wiki/Installation
++ /scripts/functions/requirements/osx_brew : requirements_osx_brew_libs_install()  63 > case "$_system_version" in
++ /scripts/functions/requirements/osx_brew : requirements_osx_brew_libs_install()  70 > return 1
Requirements installation failed with status: 1.

If some tool you are using to install software isn't working, then abandon it.

First off, you don't need a package manager to install ruby. You can go to the ruby download page and download ruby-2.1.2.tar.gz (or any other version), and install ruby by hand. Yes, I know that sounds really scary--but it's really very simple.

Open up Terminal App(look for it in Applications/Utilities), then cd into your Downloads directory:

$ cd ~/Downloads

Then untar(ie unpack the files):

~/Downloads$ tar xfvz ruby-2.1.2.tar.gz

Untaring the files will create a directory named ruby-2.1.2.
cd into that directory:

~/Downloads$ cd ruby-2.1.2

Then open the README file and/or the INSTALL file, and follow the directions. The previous steps are what you do to install most any software. The instructions in the ruby README file boil down to this:

  1. ~/Downloads/ruby-2.1.2$ ./configure
  2. ~/Downloads/ruby-2.1.2$ make
  3. ~/Downloads/ruby-2.1.2$ sudo make install

If you encounter some fatal error in those steps, then there should be plenty of information available on google.

If you plan to install multiple versions of ruby, THEN consider using rvm or rbenv...or Homebrew. Personally, I've never used a package manager like Homebrew to install anything, and I've been installing stuff on Macs for a long time. I still don't really have a clue what I'm doing, but the steps are usually so simple, it doesn't matter. And if I encounter problems, I search google.

However...package managers can be nice if something you are trying to install has lots of dependencies--but if the package manager doesn't work, then it's time to try something else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM