Я пытаюсь bundle install --gemfile=Gemfile
, но возникает ошибка:
Произошла ошибка при установке nokogiri (1.7.2), и Bundler не может продолжить работу. Перед объединением убедитесь, что
gem install nokogiri -v '1.7.2' --source 'http://rubygems.org/'
выполнено успешно.
Итак, я пытаюсь установить nokogiri, затем отказываюсь:
ОШИБКА: ошибка при установке nokogiri:
ОШИБКА: не удалось создать собственное расширение gem.
Кажется, нокогири был заблокирован. Интересно, как установить конкретную версию (1.7.2) nokogiri.
Моя ОС — Amazon Linux AMI версии 2017.09, и я установил
mysql-devel sqlite-devel libcurl-devel ruby24 ruby24-devel zlib-devel gcc libxslt-devel libxml2-devel gcc-c++ make curl
Версия Ruby — 2.4, а упаковщик версии 1.17.3. Подробная информация об ошибке:
current directory: /usr/local/share/ruby/gems/2.4/gems/nokogiri-1.7.2/ext/nokogiri
/usr/bin/ruby2.4 -r ./siteconf20190305-30890-gjsryi.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.4
with the following patches applied:
- 0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch
- 0002-Fix-XPointer-paths-beginning-with-range-to.patch
- 0003-Disallow-namespace-nodes-in-XPointer-ranges.patch
Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
sudo apt-get install build-essential patch libgmp-dev libxml2-dev libxslt1-dev zlib1g-dev liblzma-dev
- person TeWu   schedule 05.03.2019gem install nokogiri -- --use-system-libraries
работает. Спасибо за вашу любезную помощь! - person yfqin   schedule 05.03.2019