24

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.
Jim Stewart
  • 16,964
  • 5
  • 69
  • 89
好多余先生丶
  • 261
  • 1
  • 2
  • 9

5 Answers5

15

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'
Deepak Mahakale
  • 22,834
  • 10
  • 68
  • 88
TKH
  • 828
  • 6
  • 11
  • hmmm. is that a jekyll bug or what? in my case I use rvm, is that an interoperability issue between jekyll and rvm? – matanster Sep 17 '16 at 06:21
  • 1
    @matanster I guess (from the other answers in this thread) that bundler actually knows how to get the ruby version from the environment variable. But yes, it appears that rvm magic must try to parse the Gemfile and chokes on that. rvm is so ambitious! It's probably better to use a ```.ruby-version``` file instead, since that seems to be used in rvm, rbenv, and chruby. See discussion in [Is It A Bad Practice to List Ruby Version in Both Gemfile and .ruby-version Dotfile?](http://stackoverflow.com/questions/32934651/is-it-a-bad-practice-to-list-ruby-version-in-both-gemfile-and-ruby-version-dotf) – TKH Sep 20 '16 at 21:34
  • Thank you @TKH. I was overthinking the issue. I followed Jason's diagnostic step and could see Ruby was installed properly. Once I modified the gem file, the nasty message was gone. :-) – rray Jan 07 '18 at 14:56
10

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.

Jason Gilmore
  • 3,698
  • 3
  • 23
  • 28
4

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

user1201917
  • 1,360
  • 1
  • 14
  • 27
2

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.

GN.
  • 8,672
  • 10
  • 61
  • 126
  • 1
    While that certainly works, it is no no longer stating that you would prefer to run with the most current Ruby from the 2.6 minor version. – Christopher Oezbek Oct 30 '20 at 20:22
0

first make a app using npx react-native init sample-project then go to ios folder

cd ios run pod install

after running pods install you see

Generating Pods project Setting REACT_NATIVE build settings Setting CLANG_CXX_LANGUAGE_STANDARD to c++17 on /Users/mac/sample/ios/sample.xcodeproj

your app works fine and run

run yarn ios or npm run ios