2

Trying to rvm use . in order to follow the instructions in here in an attempt to fix my messed up configuration, I get the following message in console:

Unknown ruby interpreter version (do not know how to handle): RUBY_VERSION. Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile.

Which I guess refers to the variable RUBY_VERSION in the Gemfile:

source "https://rubygems.org" 
ruby RUBY_VERSION

What should I do? I guess RUBY_VERSION variable has to be defined as a system variable ?

I'm just trying to use Jekyll.

Extra info:

Now I have:

  • gem -v 2.6.14
  • ruby -v ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
  • jekyll -v fails with a very long error.
  • bundle -v Bundler version 1.14.4
Alvaro
  • 40,778
  • 30
  • 164
  • 336
  • Try adding `ruby '2.2.0'` to your gemfile (replacing RUBY_VERSION with the actual version). Let me know what you get then when you try to `bundle install` – Cyzanfar Oct 31 '17 at 14:32
  • I did, now I get `Required ruby-2.2.0 is not installed.`, even though using `ruby -v` returns me: `ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]` – Alvaro Oct 31 '17 at 16:12
  • `rvm use 2.2.0` now ruby version should be version should be set to that version – Cyzanfar Oct 31 '17 at 16:14
  • @Cyzanfar using `rvm use 2.2.0` returns `Required ruby-2.2.0 is not installed. To install do: 'rvm install "ruby-2.2.0"'` – Alvaro Oct 31 '17 at 16:41
  • I added extra info in the question. – Alvaro Oct 31 '17 at 16:43
  • ok one last try haha.`rvm install ruby-2.2.0` then `rvm --default use ruby-2.2.0` to set the default version. – Cyzanfar Oct 31 '17 at 16:44

1 Answers1

1

RUBY_VERSION should be a specific version string, like '2.4.2' (with the quotes).

However, if you don't particularly care which Ruby version you use, then you should be able to just remove the whole line and rvm will use the default.

Floppy
  • 212
  • 1
  • 9
  • I tried both. Removing it won't work as it says: `Now using system ruby. Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile. Run `rvm help` to see usage information` – Alvaro Oct 31 '17 at 16:14
  • And using a number such as 'ruby 2.0.0' shows me: `Required ruby-2.2.0 is not installed. etc....` even though using `ruby -v` returns `ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]` – Alvaro Oct 31 '17 at 16:14
  • A couple of things to try: `rvm --default use system` to make sure rvm has a good fallback, then try setting the full version string in the file, '2.0.0p648'. – Floppy Oct 31 '17 at 16:17
  • Both done, with `rvm --default use system` I got the message "Now using system ruby." twice. But nothing changed. – Alvaro Oct 31 '17 at 16:38
  • Using the whole string `2.0.0p648` didn't change anything, still getting `Required ruby-2.0.0p648 is not installed. Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile.` – Alvaro Oct 31 '17 at 16:40
  • Maybe relevant to mention I also get this in yellow ? `RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too, you can ignore these warnings with 'rvm rvmrc warning ignore ./Gemfile'. To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.` – Alvaro Oct 31 '17 at 16:40
  • Maybe it's just not picking up the system ruby. Try `rvm install 2.4.2`, then use "2.4.2" in the gemfile, see if that helps. – Floppy Oct 31 '17 at 16:41
  • Thanks that last thing solved the issue! Now I get another one. I opened this new question for it: https://stackoverflow.com/q/47046419/1081396 – Alvaro Nov 01 '17 at 00:20