I try to install Nanoc on Fedora Linux.
I've successfully installed Ruby using
dnf install ruby
Checked it with ruby -v
and made sure rubygems is installed. Also checked version to verify installation.
The command I'm using to get nanoc installed is
gem install nanoc
When that failed I also tried
sudo gem install nanoc
but I get this error:
Building native extensions. This could take a while...
ERROR: Error installing nanoc:
ERROR: Failed to build gem native extension.
current directory: /home/ja/.local/share/gem/ruby/3.3.0/gems/rbtree-0.4.6
/usr/bin/ruby extconf.rb
checking for ruby/version.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=${opt-dir}/include
--without-opt-include
--with-opt-lib=${opt-dir}/lib64
--without-opt-lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
--enable-debug
--disable-debug
--with-ruby-dir
--without-ruby-dir
--with-ruby-include=${ruby-dir}/include
--without-ruby-include
--with-ruby-lib=${ruby-dir}/lib64
--without-ruby-lib
/usr/share/ruby/mkmf.rb:480: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:606:in `block in try_compile'
from /usr/share/ruby/mkmf.rb:555:in `with_werror'
from /usr/share/ruby/mkmf.rb:606:in `try_compile'
from /usr/share/ruby/mkmf.rb:1151:in `block in have_header'
from /usr/share/ruby/mkmf.rb:983:in `block in checking_for'
from /usr/share/ruby/mkmf.rb:344:in `block (2 levels) in postpone'
from /usr/share/ruby/mkmf.rb:314:in `open'
from /usr/share/ruby/mkmf.rb:344:in `block in postpone'
from /usr/share/ruby/mkmf.rb:314:in `open'
from /usr/share/ruby/mkmf.rb:340:in `postpone'
from /usr/share/ruby/mkmf.rb:982:in `checking_for'
from /usr/share/ruby/mkmf.rb:1150:in `have_header'
from extconf.rb:8:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/ja/.local/share/gem/ruby/3.3.0/extensions/x86_64-linux/3.3.0/rbtree-0.4.6/mkmf.log
extconf failed, exit code 1
What should I be trying next? I feel like it's a dependency issue - I'm missing something. I just don't know what. This is a fresh install of Fedora.
dnf install ruby-devel
. You also (very likely) need to install other parts of Ruby too which Fedora decided to unbundle from the main package for some reason... See developer.fedoraproject.org/tech/languages/ruby/…