faehnrich
faehnrich

Reputation: 331

Error installing Jekyll, requires Ruby >= 2.0.0

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?

Upvotes: 29

Views: 15235

Answers (5)

Wesley Kelly
Wesley Kelly

Reputation: 21

If you've already installed a later version of Ruby AND you're using rbenv, and gem gives the same error, it is because you are still using the old version of gem. There are now two executables called gem in your filesystem. Figure out which gem is the default with "which":

$ which gem

If you see something like */.rbenv/shims/gem, this is not the version of gems that you want to use. The correct version of gem will be in /.rbenv/versions/[your preferred version, i.e. 2.0.0]. You can run that version of gem by including the full path to the executable:

$ sudo /path/to/correct/gem install jekyll

Upvotes: 1

mathsyouth
mathsyouth

Reputation: 4178

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

Upvotes: 4

hectorh30
hectorh30

Reputation: 763

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.

Upvotes: 40

lrkwz
lrkwz

Reputation: 6513

You can give a try to:

sudo apt-get install ruby2.0 ruby2.0-dev
sudo gem2.0 install jekyll-import 

Upvotes: 13

Martin R.
Martin R.

Reputation: 1642

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.

Upvotes: 15

Related Questions