You are not logged in.

#1 2021-01-13 13:18:28

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,563

Error updating ruby gem: Failed to build gem native extension.

I'm trying to understand why I'm getting this error when running gem update:

Updating installed gems
Updating net-pop
Building native extensions. This could take a while...
ERROR:  Error installing net-pop:
        ERROR: Failed to build gem native extension.

    current directory: /home/brightchip/.gem/ruby/2.7.0/gems/digest-3.0.0/ext/digest
/usr/bin/ruby -I /usr/lib/ruby/2.7.0 -r ./siteconf20210113-639621-5rxmfr.rb extconf.rb
creating Makefile

current directory: /home/brightchip/.gem/ruby/2.7.0/gems/digest-3.0.0/ext/digest
make "DESTDIR=" clean

current directory: /home/brightchip/.gem/ruby/2.7.0/gems/digest-3.0.0/ext/digest
make "DESTDIR="
compiling digest.c
linking shared-object digest.so

current directory: /home/brightchip/.gem/ruby/2.7.0/gems/digest-3.0.0/ext/digest
make "DESTDIR=" install
/usr/bin/install -c -m 0755 digest.so ./.gem.20210113-639621-1kv3df0
installing digest libraries
/usr/bin/install: cannot create regular file '/usr/include/ruby-2.7.0/ruby/digest.h': Permission denied
make: *** [Makefile:204: /usr/include/ruby-2.7.0/ruby/digest.h] Error 1

make install failed, exit code 2

It's probably harmless but I always like to understand why I get errors.

Here is the output of gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.4
  - RUBY VERSION: 2.7.2 (2020-10-01 patchlevel 137) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/2.7.0
  - USER INSTALLATION DIRECTORY: /home/brightchip/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /usr/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/bin
  - SPEC CACHE DIRECTORY: /home/brightchip/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/lib/ruby/gems/2.7.0
     - /home/brightchip/.gem/ruby/2.7.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--user-install"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/bin
     - /opt/cuda/bin
     - /opt/cuda/integration/nsight-compute
     - /opt/cuda/integration/nsight-systems
     - /usr/lib/jvm/default/bin
     - /usr/bin/site_perl
     - /usr/bin/vendor_perl
     - /usr/bin/core_perl
     - /home/datapool/bin
     - /opt/cuda/bin
     - /home/brightchip/.gem/ruby/2.7.0/bin
     - /home/brightchip/.local/bin

Any thoughts or solution?

Offline

#2 2021-01-26 14:24:52

mjwhitta
Member
Registered: 2011-05-17
Posts: 5

Re: Error updating ruby gem: Failed to build gem native extension.

I'm having a very similar issue:

Updating installed gems
Updating net-pop
Building native extensions. This could take a while...
ERROR:  Error installing net-pop:
        ERROR: Failed to build gem native extension.

    current directory: /home/user/.gem/ruby/gems/digest-3.0.0/ext/digest
/usr/bin/ruby -I /usr/lib/ruby/2.7.0 -r ./siteconf20210126-1830-1lhse09.rb extconf.rb
creating Makefile

current directory: /home/user/.gem/ruby/gems/digest-3.0.0/ext/digest
make "DESTDIR=" clean

current directory: /home/user/.gem/ruby/gems/digest-3.0.0/ext/digest
make "DESTDIR="
compiling digest.c
linking shared-object digest.so

current directory: /home/user/.gem/ruby/gems/digest-3.0.0/ext/digest
make "DESTDIR=" install
/usr/bin/install -c -m 0755 digest.so ./.gem.20210126-1830-18om466
installing digest libraries
/usr/bin/install: cannot remove '/usr/include/ruby-2.7.0/ruby/digest.h': Permission denied
make: *** [Makefile:204: /usr/include/ruby-2.7.0/ruby/digest.h] Error 1

make install failed, exit code 2

Gem files will remain installed in /home/user/.gem/ruby/gems/digest-3.0.0 for inspection.
Results logged to /home/user/.gem/ruby/extensions/x86_64-linux/2.7.0/digest-3.0.0/gem_make.out
Gems updated: digest

Notice that yours fails to create digest.h and mine fails to delete (which I think it shouldn't even be trying to do based on my gem env). Here is my gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.4
  - RUBY VERSION: 2.7.2 (2020-10-01 patchlevel 137) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/user/.gem/ruby
  - USER INSTALLATION DIRECTORY: /home/user/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /usr/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /home/user/.gem/ruby/bin
  - SPEC CACHE DIRECTORY: /home/user/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/user/.gem/ruby
     - /home/user/.gem/ruby/gems
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-format-executable --no-user-install"
     - "install" => "--no-format-executable --no-user-install"
     - "update" => "--no-format-executable --no-user-install"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /home/user/src/google-cloud-sdk/bin
     - /home/user/bin
     - /home/user/.local/bin
     - /home/user/.config/zsh/scripts
     - /home/user/.cache/gvm/use/bin
     - /home/user/.go
     - /home/user/.go/bin
     - /home/user/.gem/ruby/bin
     - /usr/bin/core_perl
     - /usr/bin/vendor_perl
     - /usr/local/bin
     - /usr/local/sbin
     - /usr/bin
     - /usr/sbin
     - /bin
     - /sbin

Offline

#3 2021-02-03 08:28:08

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,563

Re: Error updating ruby gem: Failed to build gem native extension.

@mjwhitta Have you found a solution yet? I tried running the update with sudo (I know it's not the right way) but no luck.

Offline

#4 2021-02-03 13:43:38

mjwhitta
Member
Registered: 2011-05-17
Posts: 5

Re: Error updating ruby gem: Failed to build gem native extension.

Nope. I also tried as sudo with no luck. I imagine it's an issue with the digest gem. It should be creating/removing digest.h in/from the proper location. I've been tinkering with the Makefile a little. No luck yet, but I might keep trying. I'll update here if I get it working tho.

Offline

#5 2021-02-04 17:04:41

btdmaster
Member
Registered: 2021-02-03
Posts: 5

Re: Error updating ruby gem: Failed to build gem native extension.

@mjwhitta @d_fajardo Non-solution until the ruby package gets updated to 3.0:

gem update --ignore-dependencies

I found this while trying to do 'gem update --ignore net-pop' which is an invalid flag. However, gem, even when lacking bash auto-completion, is able to take commands and arguments lazily (see e.g. 'gem up' and 'gem cl'). This will break net-pop but will allow for gem update to ignore net-pop until future update. To fix net-pop, simply run 'gem install net-pop' when /usr/bin/ruby reaches 3.0.0.

Why I am almost positive 3.0.0 will fix this: https://stdgems.org includes net-pop, which got updated to 0.1.1 in 3.0.0, and which is currently unmaintained.

Offline

#6 2021-02-04 20:11:27

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,563

Re: Error updating ruby gem: Failed to build gem native extension.

Great! Thanks for info.

Offline

Board footer

Powered by FluxBB