Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Maximiliane Quel
PLUS
Maximiliane Quel
Courses Plus Student 55,489 Points

Not able to upgrade to Ruby 2.2.2 using rbenv

I currently have ruby 2.1.2p95 installed on my mac. I am using the latest version of homebrew and I have rbenv 0.4.0 installed and I am using the ruby-build plugin. I tried to upgrade to ruby 2.2.2, however when I run the command I get the following error message:

ruby-build: definition not found: 2.2.2

The following versions contain `2.2.2' in the name:
  rbx-2.2.2
  rbx-2.2.2

I tried to update ruby-build but got another error saying

Error: ruby-build 20150519 already installed

when I check the list of available versions I get the following:

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-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
  1.9.3-preview1
  1.9.3-rc1
  2.0.0-dev
  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-preview1
  2.0.0-preview2
  2.0.0-rc1
  2.0.0-rc2
  2.1.0
  2.1.0-dev
  2.1.0-preview1
  2.1.0-preview2
  2.1.0-rc1
  2.1.1
  2.1.2
  2.2.0-dev
  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
  jruby-1.7.0-preview1
  jruby-1.7.0-preview2
  jruby-1.7.0-rc1
  jruby-1.7.0-rc2
  jruby-1.7.1
  jruby-1.7.10
  jruby-1.7.11
  jruby-1.7.12
  jruby-1.7.13
  jruby-1.7.14
  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-9000+graal-dev
  jruby-9000-dev
  maglev-1.0.0
  maglev-1.1.0-dev
  maglev-2.0.0-dev
  mruby-1.0.0
  mruby-dev
  rbx-1.2.4
  rbx-2.0.0
  rbx-2.0.0-dev
  rbx-2.0.0-rc1
  rbx-2.1.0
  rbx-2.1.1
  rbx-2.2.0
  rbx-2.2.1
  rbx-2.2.10
  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
  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

Any ideas on what is wrong and what the best solution would be to upgrade?

2 Answers

Tim Knight
Tim Knight
28,888 Points

You probably need to upgrade your version of rbenv to get the latest list of available Rubies

If you've installed rbenv manually using git, you can upgrade your installation to the cutting-edge version at any time.

$ cd ~/.rbenv
$ git pull

If you've installed via Homebrew, then upgrade via its brew command:

$ brew update
$ brew upgrade rbenv ruby-build
Maximiliane Quel
PLUS
Maximiliane Quel
Courses Plus Student 55,489 Points

Hi,

thanks very much for trying to help.

I have tried to update, but get a replay that rbenv is already up to date. Not sure what is going on.

Tim Knight
Tim Knight
28,888 Points

What about manually updating the ruby-build plugin by going into ~/.rbenv/plugins/ruby-build and running git pull?

ruby-build --version returns ruby-build 20150928 for me.

This would only work if you installed it manually. If you're using homebrew then you should be able to run brew upgrade ruby-build individually.

I apologize, I needed to read through your issue again since I know you've tried several things already.