64

I installed rbenv via Homebrew on an OS X 10.9.3 MacBook Pro:

brew update
brew upgrade rbenv ruby-build

According to rbenv install --list on my laptop Ruby 2.1.0-dev is the latest.

2
  • see if you have it directly on ruby-build doing ruby-build --definitions May 17, 2014 at 0:16
  • @IsmaelAbreu I do see 2.1.2 with ruby-build --definitions
    – levy
    May 17, 2014 at 0:35

10 Answers 10

92

Both rbenv and ruby-build are generally installed from Github by cloning; That's how the authors recommend we install it.

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

If you didn't do it that way I'd recommend that method. Then, you can simply do:

cd ~/.rbenv
git pull
cd plugins/ruby-build
git pull

If you have several plugins use:

cd plugins
for i in *
do
  cd $i
  git pull
  cd -
done

I update every couple weeks just to pull in the latest fixes/changes.

4
  • 1
    I will give this a try. I just love how simple homebrew is. :D (When there are no issues)
    – levy
    May 17, 2014 at 0:41
  • 2
    I had the same problem. brew upgrade ruby-build did not work. Uninstalled it (/usr/local/Cellar/ruby-build/20140225) and reinstalled it and it made no difference. I uninstalled ruby-build from brew and installed ruby-build plugin. Now I see ruby 2.1.2 available via 'rbenv install -l'
    – VBK
    Jun 2, 2014 at 19:08
  • just to point out: these instructions also work with rbenv installed to a non-standard/non-homebrew location. Just change the ~/.rbenv for your local install path (for example my machine, using boxen, puts rbenv in /opt/boxen/rbenv).
    – justin
    Aug 26, 2014 at 17:10
  • @levy brew is easy. If you type brew info ruby-build then the keg info tells you to Pull. Jun 26, 2015 at 21:21
59

I faced the same issue. I got the latest by running the following command:

brew upgrade --HEAD ruby-build
5
  • 2
    I did brew updateand then the upgrade shown here and it worked for me.
    – gabe
    Sep 19, 2014 at 20:04
  • 1
    Had this problem trying to upgrade to 2.2.2 using rbenv and it wouldn't show up on the list until I did the upgrade shown here. Regular brew upgrade didn't work.
    – Mike Grace
    Apr 15, 2015 at 16:54
  • Originally just did a brew install ruby before realizing that this had no connection to the version of Ruby provided with most Apple computers. So then ran brew uninstall ruby followed by brew upgrade --HEAD ruby and things worked just fine for me!
    – James
    Sep 24, 2015 at 23:00
  • 1
    This worked for me: brew update && brew upgrade ruby-build
    – racar
    Jul 2, 2019 at 23:06
  • 1
    This worked for me HOWEVER, it complained that --HEAD was an invalid option. I believe this has been changed to --fetch-HEAD. So this worked for me: brew upgrade --fetch-HEAD ruby-build. After running that, I saw the version I was after (the latest).
    – wetjosh
    Apr 6, 2020 at 22:42
17

I had this issue on OS X 10.8.5 (so don't think OS related). I had tried updating rbenv & ruby-build via brew. 2.1.0-dev was still latest build available.

I had to force uninstall and re-install ruby-build via brew to fix the issue.

brew uninstall ruby-build --force
brew install ruby-build
2
  • 1
    I installed rbenv and ruby-build with brew, and this worked to update the list of rubies in rbenv install -l include version 2.1.4
    – Nate Flink
    Oct 29, 2014 at 18:25
  • Needed this solution to update my version list for an rbenv installed under homebrew, on OSX Sierra 10.12.1. All other above solutions did not work.
    – Eskim0
    Mar 31, 2017 at 15:24
12

I had the same issue. Even after running

brew upgrade rbenv ruby-build

I still didn't get ruby-2.1.2 on the available list. Following how to update list of available ruby versions on linux, I updated ruby-build through the following commands

cd ~/.rbenv/plugins/ruby-build
git pull

(I'm using OS X 10.9.4 MacBook Air)

1
  • 2
    This is the most-correct answer, as it doesn't involve anything radical. The 'git pull' command can most-normally be found by running brew info ruby-build. The command is printed with the keg info. Jun 26, 2015 at 21:20
8

This happened to me today. "rbenv install -l' displays outdated list while "ruby-build --definitions" returns the correct list. The problem is fixed by executing following command:

rm -Rf ~/.rbenv/plugins/ruby-build

It seems there is an outdated version of ruby-build under ~/.rbenv/plugins. Not sure when it got generated.

2
  • I notice duplication in my ruby-build --defintions. Running your command removed the duplication, thanks.
    – levy
    Nov 13, 2014 at 18:50
  • I couldn't find 2.1.4, this fixed it for me
    – Toadums
    Nov 25, 2014 at 1:00
7

This link gives a good explanation of the two available options.

If you installed rbenv from the git repository: $ cd ~/.rbenv/plugins/ruby-build $ git pull

If you used Homebrew on OSX to install rbenv: $ brew update $ brew upgrade ruby-build (Also running brew doctor might give you the exact solution.)

And if you have permission denied errors, this is my addition: $ sudo chown -R $USER /usr/local; brew update $ sudo chown -R $USER /usr/local; brew upgrade ruby-build

Then you'll be able to install the recent versions. $ rbenv install --list $ rbenv install 2.1.2

5

The selected answer will work fine, but the issue may have simply been caused by homebrew not having an up-to-date formula for ruby-build at the time. As of this posting, the appropriate ruby-build formula has been put into the latest version of homebrew. So running:

$ brew update

should get you version needed to get the latest ruby. Then, running rbenv install --list again should list 2.1.2 (and others).

So if anyone sees this later on, hopefully you can avoid having to maintain the individual repositories if you'd rather use homebrew for package management.

0

I've just updated ruby-build and ruby-install to latest versions and both have the latest ruby 2.1.2

Probably rbenv doing something nasty.

6
  • 1
    rbenv isn't doing anything nasty. The OP is not maintaining the code. May 16, 2014 at 23:30
  • if the OP updated homebew, rbenv and ruby-build and ruby 2.1.2 does not appear on the list there is something wrong for sure. And I'm saying it should be rbenv because ruby-build has the 2.1.2 version already. Probably rbenv does some sort of caching. Probably opening a new terminal window will solve the issue. May 17, 2014 at 0:19
  • Well I have rebooted and opened new terminals windows, and still do not see 2.1.2. This is so weird.
    – levy
    May 17, 2014 at 0:39
  • What is also odd is that I checked on my iMac running OSX 10.8.5 and 2.1.2 is being listed in rbenv installed via brew.
    – levy
    May 17, 2014 at 0:51
  • I have rbenv installed (with brew) on 3 machines - all MacOS 10.9.3. On 2 machines, 2.1.2 is listed in the rbenv install --list. On the other, it is not. ruby-build 20140524 and rbenv 0.4.0. On the problem machine, ruby-build --definitions shows 2.1.2 as available.
    – jmoody
    May 28, 2014 at 9:58
0

Following all the above, on OSX 10.11 it still wouldn't list the latest versions. What I did below worked for me- I removed the dir, re-installed from brew then I had to link in brew like this:

$ brew uninstall ruby-build --force
$ rm -Rf ~/.rbenv/plugins/ruby-build

and then

$ brew install ruby-build
$ brew link --overwrite ruby-build

and then I saw the most recent versions to build.

0

cd /home/[user]/.rbenv/plugins/ruby-build && git pull && cd -

Don't forget to replace [user] with your user

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.