Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Unknown ruby interpreter version (do not know how to handle): RUBY_VERSION."

Tags:

ruby

Today i just want to setup a jekyll Blog on my Mac, and have already install ruby 2.3.0, but when make '$ jekyll serve', it's error. and show this in terminal:

Error information:

Unknown ruby interpreter version (do not know how to handle): RUBY_VERSION.
like image 489
好多余先生丶 Avatar asked Aug 04 '16 10:08

好多余先生丶


4 Answers

So it looks like

bundle exec jekyll new

will create the a Gemfile with the line

ruby RUBY_VERSION

I believe you'll want to edit that file to be e.g.

ruby '2.1.1'
like image 100
TKH Avatar answered Oct 21 '22 01:10

TKH


Coincidentally today I am also trying to setup Jekyll and am seeing the same problem. I am using RVM and it otherwise works fine (running multiple Rails dev sites locally). When I run env | grep 'RUBY' I get:

$ env | grep 'RUBY'
MY_RUBY_HOME=/Users/myusername/.rvm/rubies/ruby-2.0.0-p247
RUBY_VERSION=ruby-2.0.0-p247

However, I just continued and ran bundle install, then bundle exec jekyll serve and the site booted up without issue.

like image 34
Jason Gilmore Avatar answered Oct 21 '22 03:10

Jason Gilmore


Seems like there is no variable RUBY_VERSION in your env.

Try in your shell: env | grep 'RUBY'

Output should be like this: RUBY_VERSION=ruby-2.3.0

If you don't see anything, you need to reinstall ruby.

Use RVM or other ruby version manager. Here is a good manual

like image 4
user1201917 Avatar answered Oct 21 '22 01:10

user1201917


I used to have ruby '~> 2.6.3' in Gemfile and got same warning. I changed it to ruby '2.6.3' and it fixed it.

like image 2
GN. Avatar answered Oct 21 '22 03:10

GN.