Ruby-build: definition not found: 2.2.1

I want to install a new version of ruby ​​on rbenv install 2.2.1 , but I get an error

 ruby-build: definition not found: 2.2.1 The following versions contain 2.2.1 in the name: rbx-2.2.1 rbx-2.2.10 

Could you tell me how to install version 2.2.1?

Thanks in advance!

+6
source share
3 answers

You must upgrade ruby-build to the latest version, ruby-build is the rbenv plugin that provides the rbenv install command to compile and install different versions of Ruby on UNIX-like systems.

Using the Homebrew Package Manager:

 brew upgrade ruby-build --HEAD 

If ruby-build-HEAD is already installed, try reinstalling it

 brew reinstall ruby-build --HEAD 

You can find the current stable Ruby version number at:

https://www.ruby-lang.org/en/downloads/

Then use rbenv to view an updated list of available options:

 rbenv install --list 

Install the latest stable version as shown below (replace 2.2.2 with your version):

 rbenv install 2.2.2 rbenv rehash 

To view and check all installed versions:

 rbenv versions 

To install the global ruby ​​version (in this case 2.2.2):

 rbenv global 2.2.2 

Hope this helps you and everyone else who faces a similar situation in the future.

+12
source

Try manually updating the ruby ​​storage manually from the repository using this command:

 /Users/your-user/.rbenv/plugins/ruby-build && git pull 

Replace "your user" with a Mac user.

Once you do this, you can start the installation:

 rbenv install 2.2.1 
+1
source

I updated homebrew

 brew update && brew upgrade 

and then managed to upgrade to 2.2.1

 rbenv install '2.2.1' 

Hope this helps!

0
source

Source: https://habr.com/ru/post/984467/


All Articles