Trying to install Nanoc, but getting an error I don't know how to approach...

11 views
Skip to first unread message

Jose Sierra

unread,
Jul 10, 2024, 12:06:48 PMJul 10
to nanoc
Let me start by saying this: I'm kind of a noobler. I'm a noobler to Ruby, and it's been years since I paddled around in Linux. I can make my way through and around Linux, I have the most experience with Ubuntu/Debian, but also have some time with Fedora. Just want to give some context so the replies aren't too horrible; but I'm stuck and I'm not even sure /what/ to research. Here's the situation:

OS: ubuntu

I install ruby per the very clear instructions. Check with -v, all seems well. Install gems, and install ruby-devel tools. Installed webrick. So far, so good. Then I run sudo gem install nanoc and I get... this:

--

Building native extensions. This could take a while...
ERROR:  Error installing nanoc:
ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/3.2.0/gems/rbtree-0.4.6
/usr/bin/ruby3.2 -I/usr/lib/ruby/vendor_ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/3.2.0/gems/rbtree-0.4.6 for inspection.
Results logged to /var/lib/gems/3.2.0/extensions/x86_64-linux-gnu/3.2.0/rbtree-0.4.6/gem_make.out

--

I feel like I'm simply missing some dependency or a path might be wrong, but this is a pretty bone-stock installation of Ubuntu. I've made sure that gcc and the dev tools are installed as well. I'm just not sure what direction to take, or what to do next. Any help or advice is very much appreciated!




Eric Sunshine

unread,
Jul 10, 2024, 3:12:57 PMJul 10
to na...@googlegroups.com
On Wed, Jul 10, 2024 at 12:06 PM Jose Sierra <jo...@josesierra.com> wrote:
> Building native extensions. This could take a while...
> ERROR: Error installing nanoc:
> ERROR: Failed to build gem native extension.
> current directory: /var/lib/gems/3.2.0/gems/rbtree-0.4.6
> /usr/bin/ruby3.2 -I/usr/lib/ruby/vendor_ruby extconf.rb
> mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
>
> You might have to install separate package for the ruby development
> environment, ruby-dev or ruby-devel for example.

It appears that you are missing the Ruby header file(s) which are
needed to build/install the "rbtree" extension which is a dependency
of nanoc. You should be able resolve this by following the suggestion
above. On Ubuntu, the necessary package name is likely "ruby-dev", so
install it like this:

sudo apt update && sudo apt -y install ruby-dev

Afterward, try the nanoc installation again.
Reply all
Reply to author
Forward
0 new messages