Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing Jekyll, requires Ruby >= 2.0.0

Tags:

ruby

jekyll

I get the error

Error installing jekyll:
jekyll requires Ruby version >= 2.0.0.

when I run

sudo gem install jekyll

"ruby -v" says I have ruby version 1.9.3

How do I install Jekyll? Do I need to upgrade ruby? If so, how?

Update - I installed ruby 2.0.0 with rvm but get the same error. Since trying to install with gem, could that still be trying to install with the older version of ruby? If so, how to find and change?

like image 671
faehnrich Avatar asked Nov 03 '15 16:11

faehnrich


4 Answers

Try

sudo gem install jekyll -v 2.5

The default command apparently tries to install Jekyll 3, which was released on October 27th 2015. The 2.5 version still works with Ruby 1.9.3, and its quite allright for me, probably for you too.

like image 101
hectorh30 Avatar answered Nov 10 '22 21:11

hectorh30


I solved this issue the following way (assuming the ruby2.0 package is installed):

sudo rm /usr/bin/ruby
sudo rm /usr/bin/gem
sudo ln -s /usr/bin/ruby2.0 /usr/bin/ruby
sudo ln -s /usr/bin/gem2.0 /usr/bin/gem

Quick explanation:

/usr/bin/ruby and /usr/bin/gem are symlinks, you can check their target by entering:

ll /usr/bin/ruby
ll /usr/bin/gem 

Changing the target of these links results in changing your default ruby and gem execution. Switching to version 2.0 for instance, lets you install Jekyll 3.

like image 15
Martin R. Avatar answered Nov 10 '22 23:11

Martin R.


You can give a try to:

sudo apt-get install ruby2.0 ruby2.0-dev
sudo gem2.0 install jekyll-import 
like image 13
lrkwz Avatar answered Nov 10 '22 22:11

lrkwz


I try the following on Ubuntu 14.04:

sudo apt-get install ruby2.0 ruby2.0-dev
sudo apt-get install zlib1g-dev
sudo gem2.0 install jekyll
like image 4
mathsyouth Avatar answered Nov 10 '22 23:11

mathsyouth