Cant install jekyll on xubuntu 20.04

gem install jekyll is failing on my Xubuntu 20.04. gcc / make and required dependencies are installed.

username@ubuntu:~$ sudo gem install jekyll
Building native extensions. This could take a while...
ERROR:  Error installing jekyll:
	ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.7.0/gems/ffi-1.14.0/ext/ffi_c
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20201219-8121-arp3mj.rb extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi,/Applications/ no
checking for whether -Wl,--exclude-libs,ALL is accepted as LDFLAGS... yes
creating extconf.h
creating Makefile

Then mid the process, saw this things

Towards the end I saw these

/usr/bin/ syntax error in VERSION script
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1069:] Error 1
make[3]: Leaving directory '/var/lib/gems/2.7.0/gems/ffi-1.14.0/ext/ffi_c/libffi-x86_64-linux-gnu'
make[2]: *** [Makefile:1348: all-recursive] Error 1
make[2]: Leaving directory '/var/lib/gems/2.7.0/gems/ffi-1.14.0/ext/ffi_c/libffi-x86_64-linux-gnu'
make[1]: *** [Makefile:623: all] Error 2
make[1]: Leaving directory '/var/lib/gems/2.7.0/gems/ffi-1.14.0/ext/ffi_c/libffi-x86_64-linux-gnu'
make: *** [ "/var/lib/gems/2.7.0/gems/ffi-1.14.0/ext/ffi_c/libffi-x86_64-linux-gnu"/.libs/libffi_convenience.a] Error 2

make failed, exit code 2

Any help would be appreciated.

this usually is because the ruby devkit is not installed. I’m not familiar with your OS - so not sure how to tell you to make sure you have it, but it should get you going in the right direction I think. The ruby site usually has instructions on how to install ruby with and without the devkit.

Thank you for pointing me to the right direction… Since this was a clean install of OS, i have to install ruby-full . Its now working.

i had a similar problem… it is indeed best to follow the the docs for ubuntu installation:

sudo apt-get install ruby-full build-essential zlib1g-dev

i think the sudo apt install build-essential part tells it to install the ubuntu-dev-tools… but not certain…