Skip to content

Instantly share code, notes, and snippets.

@svetlemodry
Created February 28, 2016 17:49
Show Gist options
  • Save svetlemodry/1773e568d48cfbdae846 to your computer and use it in GitHub Desktop.
Save svetlemodry/1773e568d48cfbdae846 to your computer and use it in GitHub Desktop.
Jekyll on Fedora
gem:
--bindir ~/.local/bin
--no-ri --no-rdoc
$ gem install jekyll
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby -r ./siteconf20160228-13857-1nxr3u6.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
extconf failed, exit code 1
$ gem install jekyll
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby -r ./siteconf20160228-14308-wxwclm.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/lib64
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:587:in `try_cpp'
from /usr/share/ruby/mkmf.rb:1060:in `block in have_header'
from /usr/share/ruby/mkmf.rb:911:in `block in checking_for'
from /usr/share/ruby/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/share/ruby/mkmf.rb:321:in `open'
from /usr/share/ruby/mkmf.rb:351:in `block in postpone'
from /usr/share/ruby/mkmf.rb:321:in `open'
from /usr/share/ruby/mkmf.rb:347:in `postpone'
from /usr/share/ruby/mkmf.rb:910:in `checking_for'
from /usr/share/ruby/mkmf.rb:1059:in `have_header'
from extconf.rb:16:in `<main>'
extconf failed, exit code 1
Some time ago I had trouble getting jekyll setup on a fresh Fedora installation.
Here a note to myself to have that done quickly in the future.
$ sudo dnf install rubygems ruby-devel gcc rpm-build
$ gem install jekyll
@nikhita
Copy link

nikhita commented Aug 25, 2018

@svetlemodry thank you, this worked for me!

@davidomarf
Copy link

Glad I found this. I was having the same problems.
Thanks!

@davidomarf
Copy link

I reinstalled Fedora, and was having the same problems.I was looking online finding nothing. Then I remembered I saw one gist that solved everything. Silly me for not saving this. Thank you, again, haha.

@davidomarf
Copy link

I kept having problems after this in Fedora 30:

current directory: /home/dv/.gem/ruby/gems/eventmachine-1.2.7/ext                                                        
make "DESTDIR="                                                                                                          
g++ -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -DBUILD_FOR_RUBY -DHAVE_RB_THREAD_CALL_WITHOUT_GVL -DHAVE_RB_THREAD_FD_SELECT -DHAVE_TYPE_RB_FDSET_T -DHAVE_RB_WAIT_FOR_SINGLE_FD -DHAVE_RB_TIME_NEW -DHAVE_INOTIFY_INIT -DHAVE_INOTIFY -DHAVE_WRITEV -DHAVE_PIPE2 -DHAVE_ACCEPT4 -DHAVE_CONST_SOCK_CLOEXEC -DOS_UNIX -DHAVE_EPOLL_CREATE -DHAVE_EPOLL -DHAVE_CLOCK_GETTIME -DHAVE_CONST_CLOCK_MONOTONIC_RAW -DHAVE_CONST_CLOCK_MONOTONIC -I/usr/local/opt/openssl/include -I/opt/local/include -I/usr/local/include    -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -m64 -o binder.o -c binder.cpp                                                                          
make: g++: Command not found                                                                                             
make: *** [Makefile:237: binder.o] Error 127                                                                             

make failed, exit code 2 

If you also have make: g++: Command not found, run sudo dnf install gcc-c++

@RKiddle
Copy link

RKiddle commented Oct 17, 2019

Thanks.

@wisdomwhale
Copy link

Thanks also. Contributions worked including davidomarf's

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment