Project

General

Profile

Actions

Bug #18398

closed

bundler cannot install digest

Added by Tietew (Toru Iwase) about 3 years ago. Updated about 3 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-12-08T23:58:25Z master 45c5794d32) [x86_64-linux]
[ruby-core:106565]

Description

bundle install gives up installing digest gem
due to trying to write digest.so in global site_ruby directory (not writable).

How to reproduce

In clean directory, create a following Gemfile:

source 'https://rubygems.org'
gem 'net-smtp'

Set bundle path to vendor/bundle and install.

$ bundle -v
Bundler version 2.3.0.dev
$ bundle config set --local path vendor/bundle
$ bundle install

Expected result

All gems are successfully installed in vendor/bundle.

Actual result

$ bundle install
Fetching gem metadata from https://rubygems.org/.
Using bundler 2.3.0.dev
Using io-wait 0.2.1
Using timeout 0.2.0
Fetching digest 3.0.0
Using net-protocol 0.1.2
Installing digest 3.0.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0/ext/digest
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/bin/ruby -I
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0 -r
./siteconf20211209-660991-1c5c0k.rb extconf.rb
creating Makefile

current directory:
/***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0/ext/digest
make DESTDIR\= clean

current directory:
/***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0/ext/digest
make DESTDIR\=
compiling digest.c
linking shared-object digest.so

current directory:
/***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0/ext/digest
make DESTDIR\= install
/usr/bin/install -c -m 0755 digest.so ./.gem.20211209-660991-1jo093
/usr/bin/mkdir: cannot create directory
‘/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/include/ruby-3.1.0/site_ruby’: Permission denied
make: *** [Makefile:212: .sitehdrdir.time] Error 1

make install failed, exit code 2

Gem files will remain installed in
/***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0 for
inspection.
Results logged to
/***/test/ruby31/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0-static/digest-3.0.0/gem_make.out

/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in `run'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/builder.rb:44:in `block in make'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in `each'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in `make'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:63:in `block in build'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/tempfile.rb:317:in `open'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in `build'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in `build_extension'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in `block in build_extensions'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in `each'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in `build_extensions'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/rubygems/installer.rb:837:in `build_extensions'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:71:in `build_extensions'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:28:in `install'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/source/rubygems.rb:204:in `install'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:54:in `install'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:16:in `install_from_spec'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:186:in `do_install'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/worker.rb:62:in `apply_func'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/worker.rb:57:in `block in process_queue'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/worker.rb:54:in `loop'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/worker.rb:54:in `process_queue'
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0/bundler/worker.rb:91:in `block (2 levels) in create_threads'

An error occurred while installing digest (3.0.0), and Bundler cannot
continue.

In Gemfile:
  net-smtp was resolved to 0.3.0, which depends on
    digest

digest-3.0.0/gem_make.out

current directory: /***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0/ext/digest
/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/bin/ruby -I /usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/lib/ruby/3.1.0 -r ./siteconf20211209-660991-1c5c0k.rb extconf.rb
creating Makefile

current directory: /***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0/ext/digest
make DESTDIR\= clean

current directory: /***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0/ext/digest
make DESTDIR\=
compiling digest.c
linking shared-object digest.so

current directory: /***/test/ruby31/vendor/bundle/ruby/3.1.0/gems/digest-3.0.0/ext/digest
make DESTDIR\= install
/usr/bin/install -c -m 0755 digest.so ./.gem.20211209-660991-1jo093
/usr/bin/mkdir: cannot create directory ‘/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/include/ruby-3.1.0/site_ruby’: Permission denied
make: *** [Makefile:212: .sitehdrdir.time] Error 1

make install failed, exit code 2

Updated by hsbt (Hiroshi SHIBATA) about 3 years ago

Can you try it with --pre option? We fixed installation issue at digest-3.1.0.preX.

Updated by Tietew (Toru Iwase) about 3 years ago

  • Description updated (diff)

Seems to be resolved. Thank you.

Run gem installwith --pre under bundler ... ok

$ bundle exec gem install digest --pre
Fetching digest-3.1.0.pre3.gem
Building native extensions. This could take a while...
Successfully installed digest-3.1.0.pre3
Parsing documentation for digest-3.1.0.pre3
Installing ri documentation for digest-3.1.0.pre3
Done installing documentation for digest after 0 seconds
1 gem installed

Adding digest >= 3.1.0.pre0 to Gemfile ... ok

$ cat Gemfile
source 'https://rubygems.org'
gem 'net-smtp'
gem 'digest', '>= 3.1.0.pre0'
$ rm -rf vendor/
$ bundle install
Fetching gem metadata from https://rubygems.org/.
Using digest 3.1.0.pre3
Using timeout 0.2.0
Using bundler 2.3.0.dev
Fetching io-wait 0.2.1
Installing io-wait 0.2.1 with native extensions
Using net-protocol 0.1.2
Fetching net-smtp 0.3.0
Installing net-smtp 0.3.0
Bundle complete! 2 Gemfile dependencies, 6 gems now installed.
Bundled gems are installed into `./vendor/bundle`

NOTE: Run gem install without --pre ... ERROR

$ bundle exec gem install digest
Fetching digest-3.0.0.gem
Building native extensions. This could take a while...
ERROR:  Error installing digest:
        ERROR: Failed to build gem native extension.
(...)
/usr/bin/mkdir: cannot create directory ‘/usr/local/anyenv/envs/rbenv/versions/3.1.0-dev/include/ruby-3.1.0/site_ruby’: Permission denied

Updated by hsbt (Hiroshi SHIBATA) about 3 years ago

  • Status changed from Open to Closed
  • Assignee set to hsbt (Hiroshi SHIBATA)
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0