Issues Installing Ruby 2.5.1

When attempting rbenv install 2.5.1, I get:

ruby-build: definition not found: 2.5.1

See all available versions with `rbenv install --list’.

If the version you need is missing, try upgrading ruby-build:

brew update && brew upgrade ruby-build

When checking --list, I get:

Available versions:
1.8.6-p383
1.8.6-p420
1.8.7-p249
1.8.7-p302
1.8.7-p334
1.8.7-p352
1.8.7-p357
1.8.7-p358
1.8.7-p370
1.8.7-p371
1.8.7-p374
1.8.7-p375
1.9.1-p378
1.9.1-p430
1.9.2-p0
1.9.2-p180
1.9.2-p290
1.9.2-p318
1.9.2-p320
1.9.2-p326
1.9.2-p330
1.9.3-dev
1.9.3-preview1
1.9.3-rc1
1.9.3-p0
1.9.3-p125
1.9.3-p194
1.9.3-p286
1.9.3-p327
1.9.3-p362
1.9.3-p374
1.9.3-p385
1.9.3-p392
1.9.3-p429
1.9.3-p448
1.9.3-p484
1.9.3-p545
1.9.3-p547
2.0.0-dev
2.0.0-preview1
2.0.0-preview2
2.0.0-rc1
2.0.0-rc2
2.0.0-p0
2.0.0-p195
2.0.0-p247
2.0.0-p353
2.0.0-p451
2.0.0-p481
2.0.0-p576
2.1.0-dev
2.1.0-preview1
2.1.0-preview2
2.1.0-rc1
2.1.0
2.1.1
2.1.2
2.1.3
2.2.0-dev
2.2.0-preview1
jruby-1.5.6
jruby-1.6.3
jruby-1.6.4
jruby-1.6.5
jruby-1.6.5.1
jruby-1.6.6
jruby-1.6.7
jruby-1.6.7.2
jruby-1.6.8
jruby-1.7.0-preview1
jruby-1.7.0-preview2
jruby-1.7.0-rc1
jruby-1.7.0-rc2
jruby-1.7.0
jruby-1.7.1
jruby-1.7.2
jruby-1.7.3
jruby-1.7.4
jruby-1.7.5
jruby-1.7.6
jruby-1.7.7
jruby-1.7.8
jruby-1.7.9
jruby-1.7.10
jruby-1.7.11
jruby-1.7.12
jruby-1.7.13
jruby-1.7.14
jruby-1.7.15
jruby-1.7.16
jruby-9000-dev
jruby-9000+graal-dev
maglev-1.0.0
maglev-1.1.0-dev
maglev-2.0.0-dev
mruby-dev
mruby-1.0.0
rbx-1.2.4
rbx-2.0.0-dev
rbx-2.0.0-rc1
rbx-2.0.0
rbx-2.1.0
rbx-2.1.1
rbx-2.2.0
rbx-2.2.1
rbx-2.2.2
rbx-2.2.3
rbx-2.2.4
rbx-2.2.5
rbx-2.2.6
rbx-2.2.7
rbx-2.2.9
rbx-2.2.10
ree-1.8.6-2009.06
ree-1.8.7-2009.09
ree-1.8.7-2009.10
ree-1.8.7-2010.01
ree-1.8.7-2010.02
ree-1.8.7-2011.03
ree-1.8.7-2011.12
ree-1.8.7-2012.01
ree-1.8.7-2012.02
topaz-dev

2.5.1 doesn’t seem to be an option. I tried brew update && brew upgrade ruby-build but still cannot install 2.5.1.

Am I missing something?

Try running:

brew upgrade --HEAD ruby-build

I’ve heard this works over standard brew update && upgrade. Also might want to run brew doctor afterwards.

Thanks for the suggestion. It ended with: Error: invalid option: --HEAD

So far I haven’t had any trouble with Ruby 2.7.0 and my non-ideal install situation. I’m working through Classes now in Software Engineering Foundations so hopefully my deviation from the a/A install instructions won’t be a big deal but will see how it goes for the Ruby and Rails sections…

I’m sure 2.5.1 was just the latest during a/A recordings. 2.7.0 should be fine. I’m using 2.6.5 without any issues.

If you do get really curious with 2.5.1 not showing up on your --list, Google stack overflow and Ruby 2.5.1 not showing up etc. Lots of similar threads with different solutions. Seems the cleanest solution is to remove Homebrew and start fresh (or some variant of this route). Might want to run a brew doctor and see what it says as well. But for now, it is what it is. Good luck.

1 Like

Awesome, good to know there should be no issues with a post-2.5.1 version