2

I have some issues with upgrading my Ruby version with RVM on OS X.

RMV uses MacPorts, causing me to run sudo port selfupdate, which gets a bunch of compiling errors, despite correct Xcode command line tools installed.

I found some installation instructions using Linux apt-get but unfortunately I don't have in it on my Mac.

I want to install Ruby without RVM. How can I do that?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
epsilones
  • 11,279
  • 21
  • 61
  • 85
  • 2
    Do you have Homebrew? See this: http://stackoverflow.com/questions/12287882/installing-ruby-with-homebrew – superEb Jul 06 '13 at 16:26
  • RVM has a [whole page in its docs for MacPorts integration](http://rvm.io/integration/macports). – Andrew Marshall Jul 06 '13 at 16:27
  • @AndrewMarshall thank you but I know about this page, and I always get the same error : `command failed: cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make && make install SELFUPDATING=1 Exit code: 2 DEBUG: Error installing new MacPorts base:...Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed` – epsilones Jul 06 '13 at 16:34
  • @superEb I think it is the best way to do, I knew about `MacPorts` having some compatibility pb with `Lion``, and their official instructions don't do the trick for me. Thanks, I think I 'll use `rbenv`, which a `rvm`-like tool. Perpahs, you should consider edit your post as the answer ;) – epsilones Jul 06 '13 at 16:55

2 Answers2

3

In case Macports does not work for you, try Homebrew:

rvm autolibs homebrew

Please note: Although it is not required, you might want to install Homebrew before using it with autolibs. It keeps Homebrew out of RVM directories.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
mpapis
  • 52,729
  • 14
  • 121
  • 158
1

Using Homebrew, you can either install and manage a single version of Ruby:

brew update
brew install ruby

Or, even better, use rbenv as a flexible alternative to RVM:

brew update
brew install rbenv
brew install ruby-build
rbenv install 2.0.0-p247
rbenv rehash

rbenv then makes it easy to use a specific version of Ruby either globally or per project (which can then be added to source control).

Note that you may want to follow the advice from rbenv's "caveats" (brew info rbenv), particularly the part about adding eval "$(rbenv init -)" to your profile.

Community
  • 1
  • 1
superEb
  • 5,613
  • 35
  • 38
  • 1
    `brew install ruby` is all I ever want for my simple Ruby needs - I just use Ruby 2 for nanoc and the odd sysadmin script. I can easily update if necessary, and can aslo just dump all of Homebrew and its installs in one go if I ever need to. I used rvm for a couple of years, but it was way too much overkill and a little too problematic an install on new machines for my liking. – Dave Everitt Dec 01 '13 at 15:47