Need help installing Jekyll

Hello to all installation gurus,

After upgrading to Ubuntu 20.04.4 I attempted to install Jekyll with no apparent difficulties. The following two commands were successful:

$ sudo apt-get install ruby-full build-essential zlib1g-dev
$ gem install jekyll bundler

I also updated all gems with $ sudo gem update, and I set environment variables in .bashrc as:

export GEM_HOME=“$HOME/gems”
export PATH=“$HOME/gems/bin:$PATH”

But when I try to use Jekyll, all that happens is I get the same 14 “Traceback” errors:

$ jekyll new myblog
Traceback (most recent call last):
14: from /home/admin/gems/bin/jekyll:23:in <main>' 13: from /home/admin/gems/bin/jekyll:23:in load’

“admin” is my home account name, not anything special. I get the same result if I simply type jekyll with no arguments. I’m stuck. Please help! Thanks.

what is the full output? sometimes if you look close at all the paths you will see ruby is installed in 2 places and it doesn’t work.

Hi. Thanks for replying. Here is the full output when I attempt to create a site:

$ jekyll new myblog
Traceback (most recent call last):
	14: from /home/admin/gems/bin/jekyll:23:in `<main>'
	13: from /home/admin/gems/bin/jekyll:23:in `load'
	12: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/exe/jekyll:8:in `<top (required)>'
	11: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	10: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	 9: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll.rb:191:in `<top (required)>'
	 8: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll.rb:12:in `require_all'
	 7: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll.rb:12:in `each'
	 6: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll.rb:13:in `block in require_all'
	 5: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 4: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 3: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/drops/collection_drop.rb:3:in `<top (required)>'
	 2: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/drops/collection_drop.rb:4:in `<module:Jekyll>'
	 1: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/drops/collection_drop.rb:5:in `<module:Drops>'
/var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/drops/collection_drop.rb:10:in `<class:CollectionDrop>': undefined method `delegate_method_as' for Jekyll::Drops::CollectionDrop:Class (NoMethodError)

I also checked that the installed Jekyll was being referenced:

$ which jekyll

That looks right. Is it a Ruby problem? I don’t know Ruby well (i.e. hardly at all).

hmm, I tried to edit your reply to clean up the formatting and now it is gone??

In the email that the forum sent me it looks like you have ruby bits in 3 different places?

$ jekyll new myblog
Traceback (most recent call last):
14: from /home/admin/gems/bin/jekyll:23:in <main>' 13: from /home/admin/gems/bin/jekyll:23:in load’
12: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/exe/jekyll:8:in <top (required)>' 11: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in require’
10: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in require' 9: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll.rb:191:in <top (required)>’
8: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll.rb:12:in require_all' 7: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll.rb:12:in each’
6: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll.rb:13:in block in require_all' 5: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require’
4: from /usr/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require' 3: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/drops/collection_drop.rb:3:in <top (required)>’
2: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/drops/collection_drop.rb:4:in <module:Jekyll>' 1: from /var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/drops/collection_drop.rb:5:in module:Drops’
/var/lib/gems/2.7.0/gems/jekyll-4.2.2/lib/jekyll/drops/collection_drop.rb:10:in <class:CollectionDrop>': undefined method delegate_method_as’ for Jekyll::Drops::CollectionDrop:Class (NoMethodError)
  • usr/lib
  • var/lib
  • home/admin

normally when I see that in the output it is bad and uninstalling and re-installing is the fix.

I’m no ruby (or linux) expert though so take that into account. My guess is ruby was already installed and some of the things it wants are in that directory, then you have the new stuff in another place and I don’t think that works.

Thanks very much. I am not having any luck at all. I removed gem, rvm, and ruby using apt-get, and then I reinstalled using sudo apt-get install on ruby, ruby-full, and gem. Still, I continue to get TRACEBACK errors on any Ruby program:

$ jekyll -v
Traceback (most recent call last):
1: from internal:gem_prelude:1:in <internal:gem_prelude>' <internal:gem_prelude>:1:in require’: cannot load such file – rubygems.rb (LoadError)

What is the correct way to install Ruby and Jekyll from scratch? I have tried every apt-get and snap command that I can find in help forums, and now I am truly stuck. Suggestions needed on how to get Ruby working again! Thanks!

This post in in direct response to the following question:

Have you tried the official Jekyll docs? I am not Ubuntu user, but can help in one of two ways:

:page_facing_up: Official Jekyll docs

:whale: Use a Docker container (my favorite)

I created this video that walks you through setting up a Docker container. This is a very powerful method because you do not have to install Ruby or Jekyll on your local machine and deal with version issues. You might want to give it a try. I have all but stopped using Ruby and Jekyll on my computer.

I am following the official Jekyll guide. First step is to check Ruby version:

tom@–>:…/~$ ruby -v
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

That looks good. Next step is to check gem but, even after reinstalling gem it does not load:

tom@–>:…/~$ gem -v
Traceback (most recent call last):
1: from internal:gem_prelude:1:in <internal:gem_prelude>' <internal:gem_prelude>:1:in require’: cannot load such file – rubygems.rb (LoadError)

The rest of the requirements concerning cpp all pass normally,

I cannot run Jekyll nor any other gems even after purging and reinstalling Ruby. What am I doing wrong? I have yet to run Jekyll at all even once. Thanks for any help you can give me.

Anybody have any other suggestions? I’m stuck and Jekyll doesn’t run.

Working on another thread on Ubuntu as well, I set up a blank environment today and ran the instructions listed here:

It looks like the commands you are running are not the same as the ones listed in the Jekyll docs.

Can you run those instructions exactly as described and then share the full output (not just a selection) of the entire error message when it occurs?

Yea! I have finally installed Jekyll and successfully created a test site. I suspect my troubles were from my upgrading Ubuntu 18 to 20, skipping version 19, which might have left my system in an inconsistent or maybe unstable state. FWIW I took the following steps to install Ruby, RVM, and finally Jekyll successfully:

  1. Backed up and then edited /var/lib/dpkg/status. Deleted all entries for rvm, plus other gems and packages that, although installed via apt-get, would not load and run (e.g. Asciidoctor), and then:

sudo dpkg --configure -a
sudo apt-get -f install
sudo apt autoremove
sudo apt-get install rvm
sudo usermod -a -G rvm $USER
source /etc/profile.d/ # also add to .bashrc
rvm install 2.7 # or 3.0
rvm use 2.7 # or 3.0
gem install jekyll bundler

  1. I received a system Makefile error on the last step, during the Jekyll build, which might indicate a bug in the Jekyll installer. The build halted with an error stating that /usr/bin/mkdir does not exist. Say wha??? On my system, mkdir is stored in /bin – but it does seem odd for the installer to expect a system command like mkdir to be installed in any specific location. After realizing that to be the source of the Makefile failure, I executed:

sudo cp /bin/mkdir /usr/bin/mkdir

which might understandably raise an eyebrow – a symlink would perhaps be wiser – but it fixed the problem and, after making that single change, gem install Jekyll finally builds and finishes normally.

I do hope this helps others solve tricky installation problems. Jekyll now runs and I’m building sites and learning the ropes! Thanks to all who responded with advice.

Alright! Congratulations on getting yourself set up! I’m impressed with your resolution and thank you for documenting these steps for everyone else here to use.

Good luck Jekylling now!

You’re welcome. And thank you!

1 Like