2

Show messages errors:

Required ruby-2.6.1 is not installed.
To install do: 'rvm install "ruby-2.6.1"'

ruby -v

ruby 2.6.1p33 (2019-01-30 revision 66950) [x64-mingw32]

rails -v

Rails 5.2.2
Hokly Leng
  • 43
  • 1
  • 7

3 Answers3

4

First of all, I doubt that RVM may not be updated to support this version of Ruby. As I know the following version is supported, you can version by following command and response should match.

rvm --version
1.29.7

If you have updated version then I will do the following to check if RVM has also the same version of ruby installed.

I will check the content of my project root folder's following file

cat .ruby-version

If it has mention same, as rvm is also complaining that I will run the following command on rvm to check if this ruby is really installed in RVM

rvm list

It will show a list of rubies installed and it should include 2.6.1 in the end. If you can't see this list then you probably need to install using the following command

rvm install "ruby-2.6.1"

If it is showing than can you try the following command and see what result comes

rvm use 2.6.1

If all good, then try the following command to see which ruby is being used

which ruby

response must include .rvm/rubies/ mean you are using .rvm ruby otherwise, you may using the system built in ruby. Just wrote may help you to diagnos issue.

Kamal Panhwar
  • 2,345
  • 3
  • 21
  • 37
  • You have to install ruby try `rvm install "ruby-2.6.1"` – Kamal Panhwar Feb 13 '19 at 04:59
  • **rvm --version** `rvm 1.29.7-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]` **cat .ruby-version** `ruby-2.6.1` **rvm list** `# No rvm rubies installed yet. Try 'rvm help install'.` – Hokly Leng Feb 13 '19 at 05:01
  • **rvm install "ruby-2.6.1"** `Searching for binary rubies, this might take some time. No binary rubies available for: mingw/unknown/x86_64/ruby-2.6.1. Continuing with compilation. Please read 'rvm help mount' to get more informatio Checking requirements for mingw. Requirements support for mingw is not implemented yet, report a bug here => https://github.com/rvm/rvm/issues Requirements installation failed with status: 1` **and It's show warning** – Hokly Leng Feb 13 '19 at 05:03
  • **Warning** `Warning, new version of rvm available '1.29.7', you are using older version '1.29.7-next'. You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc` – Hokly Leng Feb 13 '19 at 05:04
  • which OS you are using? please do `echo rvm_autoupdate_flag=2 >> ~/.rvmrc` and try again to install `rvm install "ruby-2.6.1"` – Kamal Panhwar Feb 13 '19 at 05:14
  • I used windows 10, I'm trying to install again like you tell, but It's show the same errors. hmmm – Hokly Leng Feb 13 '19 at 07:31
  • Well honestly I don't use windows from 6 years, so my suggestion why do you need 2.6.1? it is very latest and will take time, you can use 2.5.1 you have to go in your project folder and change `.ruby-version` and change Gemfile where ruby version is mentioned. I leave you here as I don't use windows. – Kamal Panhwar Feb 13 '19 at 09:49
  • Excuse me brother! I had downgrade ruby version to 2.2.6 but It's still alert me `Required ruby-2.2.6 is not installed. To install do: 'rvm install "ruby-2.2.6"' ` – Hokly Leng Feb 28 '19 at 01:18
  • try to run command `rvm install "ruby-2.2.6"` and if still have problem seems you have the problem with RVM installation, so following [https://rvm.io/rubies/removing] – Kamal Panhwar Feb 28 '19 at 06:51
  • Thank you very much brother, I had fixed it. – Hokly Leng Mar 01 '19 at 04:54
  • if my answer helps you then accept the answer by click tick mark, if there was another problem, please share so people can know issue and it helps others. Thank you. – Kamal Panhwar Mar 01 '19 at 07:25
  • That problems I'm not sure, but when I change path in my computer. It's don't have problem when I run it. – Hokly Leng Mar 01 '19 at 10:09
0

Are you using rbenv? If so, I'd recommend running rvm implode as described here.

0

if you are using rbenv

see if you have it available in your list :

rbenv install --list | grep 2.6.1

if not, fetch it

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

now if you try again

rbenv install -l | grep 2.6.1

so just run the installation command:

rbenv install 2.6.1
Downloading ruby-2.6.1.tar.bz2...  08:36:17
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.1.tar.bz2
Installing ruby-2.6.1...
Installed ruby-2.6.1 to ~/.rbenv/versions/2.6.1

now you can use it for global or local projects. if local :

rbenv local 2.6.1
milaziggy
  • 11
  • 2