#ruby #openssl #bundle #rvm #gemfile
Вопрос:
У меня возникла ошибка, в то время как bundle install
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
/home/vivek/.rvm/gems/ruby-2.6.6/gems/openssl-2.2.0/ext/openssl
/usr/share/rvm/rubies/ruby-2.6.6/bin/ruby -I
/usr/share/rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0 -r
./siteconf20210817-4774-ci9poy.rb extconf.rb
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for openssl/ssl.h... no
*** 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}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/share/rvm/rubies/ruby-2.6.6/bin/$(RUBY_BASE_NAME)
--with-openssl-dir
--without-openssl-dir
--with-openssl-include
--without-openssl-include=${openssl-dir}/include
--with-openssl-lib
--without-openssl-lib=${openssl-dir}/lib
--with-kerberos-dir
--without-kerberos-dir
--with-kerberos-include
--without-kerberos-include=${kerberos-dir}/include
--with-kerberos-lib
--without-kerberos-lib=${kerberos-dir}/lib
--with-debug
--without-debug
--enable-debug
--disable-debug
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
extconf.rb:99:in `<main>': OpenSSL library could not be found. You might want to
use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is
installed. (RuntimeError)
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/home/vivek/.rvm/gems/ruby-2.6.6/extensions/x86_64-linux/2.6.0/openssl-2.2.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/home/vivek/.rvm/gems/ruby-2.6.6/gems/openssl-2.2.0 for inspection.
Results logged to
/home/vivek/.rvm/gems/ruby-2.6.6/extensions/x86_64-linux/2.6.0/openssl-2.2.0/gem_make.out
An error occurred while installing openssl (2.2.0), and Bundler cannot
continue.
Make sure that `gem install openssl -v '2.2.0' --source 'https://rubygems.org/'`
succeeds before bundling.
In Gemfile:
openssl
затем при установке gem install openssl -v '2.2.0' --source 'https://rubygems.org/'
Building native extensions. This could take a while...
ERROR: Error installing openssl:
ERROR: Failed to build gem native extension.
current directory: /home/vivek/.rvm/gems/ruby-2.6.6/gems/openssl-2.2.0/ext/openssl
/usr/share/rvm/rubies/ruby-2.6.6/bin/ruby -I /usr/share/rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210817-5107-y9i9dg.rb extconf.rb
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for openssl/ssl.h... no
*** 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}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/share/rvm/rubies/ruby-2.6.6/bin/$(RUBY_BASE_NAME)
--with-openssl-dir
--without-openssl-dir
--with-openssl-include
--without-openssl-include=${openssl-dir}/include
--with-openssl-lib
--without-openssl-lib=${openssl-dir}/lib
--with-kerberos-dir
--without-kerberos-dir
--with-kerberos-include
--without-kerberos-include=${kerberos-dir}/include
--with-kerberos-lib
--without-kerberos-lib=${kerberos-dir}/lib
--with-debug
--without-debug
--enable-debug
--disable-debug
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
extconf.rb:99:in `<main>': OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed. (RuntimeError)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/vivek/.rvm/gems/ruby-2.6.6/extensions/x86_64-linux/2.6.0/openssl-2.2.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/vivek/.rvm/gems/ruby-2.6.6/gems/openssl-2.2.0 for inspection.
Results logged to /home/vivek/.rvm/gems/ruby-2.6.6/extensions/x86_64-linux/2.6.0/openssl-2.2.0/gem_make.out
Моя проблема в том, что я хочу сделать bundle install
Этот вопрос связан с:
-openssl -v ‘2.2.0’
Вот мои текущие сведения о среде:
rvm —версия rvm 1.29.12 (руководство) Михала Паписа, Петра Кучинского, Уэйна Э. Сегина [https://rvm.io]
ruby —версия ruby 2.6.6p146 (2020-03-31 редакция 67876) [x86_64-linux]
комплект —версия комплектующего версия 2.2.21
Комментарии:
1. Взгляните на
/home/vivek/.rvm/gems/ruby-2.6.6/extensions/x86_64-linux/2.6.0/openssl-2.2.0/mkmf.log
— он должен содержать подсказки о основной причине сбоя установки openssl (скорее всего, отсутствуют некоторые зависимости).2. Это в сообщении об ошибке: «Не удалось найти библиотеку OpenSSL. Возможно, вы захотите использовать
--with-openssl-dir=<dir>
опцию, чтобы указать префикс, в котором установлен OpenSSL.» Подробные сведения о том, как это использовать, см. в документации .3. В любом случае вам нужны заголовки OpenSSL C, доступные в вашей системе.