やきにくとくにきや

WEBサービスとイベントに夢見るエンジニアの技術メモ、チラシの裏。そして焼肉たべたい

bundle install がうまくいかない

      2018/10/22

vagrantで仮想化した環境で bundle install がうまくいかない。

自分の場合は開発環境がwindowsに入れたvagrant上にあるのでよくぶち当たる。

 

[shell]
[vagrant@vagrant-centos65 appname]$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies......
Using rake 12.3.1
Using concurrent-ruby 1.0.5
Using minitest 5.11.3
Using thread_safe 0.3.6
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.3.0
Using crass 1.0.4
Using rack 2.0.5
Fetching nio4r 2.3.1
Using websocket-extensions 0.1.3
Using mini_mime 1.0.1
Using arel 9.0.0
Using mimemagic 0.3.2
Using public_suffix 3.0.3
Using io-like 0.3.0
Fetching bindex 0.5.0
Fetching msgpack 1.2.4
Installing bindex 0.5.0 with native extensions
Installing msgpack 1.2.4 with native extensions
Installing nio4r 2.3.1 with native extensions
Using bundler 1.16.6
Fetching byebug 10.0.2
Installing byebug 10.0.2 with native extensions
Fetching ffi 1.9.25
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using method_source 0.9.0
Using thor 0.20.0
Using csv 3.0.0
Using multi_json 1.13.1
Using rb-fsevent 0.10.3
Using ruby_dep 1.5.0
Fetching mysql2 0.5.2
Fetching puma 3.12.0
Installing mysql2 0.5.2 with native extensions
Installing ffi 1.9.25 with native extensions
Installing puma 3.12.0 with native extensions
Using rubyzip 1.2.2
Using tilt 2.0.8
Using turbolinks-source 5.2.0
Using i18n 1.1.0
Using tzinfo 1.2.5
Fetching nokogiri 1.8.4
Using rack-test 1.1.0
Fetching websocket-driver 0.7.0
Installing websocket-driver 0.7.0 with native extensions
Installing nokogiri 1.8.4 with native extensions
Using mail 2.7.0
Using marcel 0.3.3
Using addressable 2.5.2
Using archive-zip 0.11.0
Using sprockets 3.7.2
Using coffee-script 2.4.1
Using uglifier 4.1.19
Using activesupport 5.2.1
Using turbolinks 5.2.0
Using globalid 0.4.1
Using activemodel 5.2.1
Using jbuilder 2.7.0
Using spring 2.0.2
Using activejob 5.2.1
Using activerecord 5.2.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.4/ext/nokogiri
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-1j5lomq.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.3.0
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.8
with the following patches applied:
- 0001-Revert-Do-not-URI-escape-in-server-side-includes.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.
************************************************************************
Extracting libxml2-2.9.8.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.8... OK
Running git apply with /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.4/patches/libxml2/0001-Revert-Do-not-URI-escape-in-server-side-includes.patch... OK
Running 'configure' for libxml2 2.9.8... OK
Running 'compile' for libxml2 2.9.8... OK
Running 'install' for libxml2 2.9.8... OK
Activating libxml2 2.9.8 (from /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.4/ports/x86_64-pc-linux-gnu/libxml2/2.9.8)...
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxslt-1.1.32.

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
************************************************************************
Extracting libxslt-1.1.32.tar.gz into tmp/x86_64-pc-linux-gnu/ports/libxslt/1.1.32... OK
Running 'configure' for libxslt 1.1.32... OK
Running 'compile' for libxslt 1.1.32... OK
Running 'install' for libxslt 1.1.32... OK
Activating libxslt 1.1.32 (from /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.4/ports/x86_64-pc-linux-gnu/libxslt/1.1.32)...
checking for -llzma... no
checking for xmlParseDoc() in libxml/parser.h... yes
checking for xsltParseStylesheetDoc() in libxslt/xslt.h... yes
checking for exsltFuncRegister() in libexslt/exslt.h... yes
checking for xmlHasFeature()... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-1j5lomq.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/nokogiri-1.8.4 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/nokogiri-1.8.4/gem_make.out

An error occurred while installing nokogiri (1.8.4), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.8.4' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
rails was resolved to 5.2.1, which depends on
actioncable was resolved to 5.2.1, which depends on
actionpack was resolved to 5.2.1, which depends on
actionview was resolved to 5.2.1, which depends on
rails-dom-testing was resolved to 2.0.3, which depends on
nokogiri

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/nio4r-2.3.1/ext/nio4r
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-143r8th.rb extconf.rb
checking for unistd.h... yes
checking for sys/select.h... yes
checking for port_event_t in poll.h... no
checking for sys/epoll.h... yes
checking for sys/event.h... no
checking for port_event_t in port.h... no
checking for sys/resource.h... yes
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-143r8th.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/nio4r-2.3.1 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/nio4r-2.3.1/gem_make.out

An error occurred while installing nio4r (2.3.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.3.1' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
rails was resolved to 5.2.1, which depends on
actioncable was resolved to 5.2.1, which depends on
nio4r

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/websocket-driver-0.7.0/ext/websocket-driver
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-1ex875e.rb extconf.rb
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-1ex875e.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/websocket-driver-0.7.0 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/websocket-driver-0.7.0/gem_make.out

An error occurred while installing websocket-driver (0.7.0), and Bundler cannot continue.
Make sure that `gem install websocket-driver -v '0.7.0' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
rails was resolved to 5.2.1, which depends on
actioncable was resolved to 5.2.1, which depends on
websocket-driver

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/bindex-0.5.0/ext/bindex
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-103aio9.rb extconf.rb
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-103aio9.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/bindex-0.5.0 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/bindex-0.5.0/gem_make.out

An error occurred while installing bindex (0.5.0), and Bundler cannot continue.
Make sure that `gem install bindex -v '0.5.0' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
web-console was resolved to 3.7.0, which depends on
bindex

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/msgpack-1.2.4/ext/msgpack
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-1sctzt8.rb extconf.rb
checking for ruby/st.h... yes
checking for st.h... yes
checking for rb_str_replace() in ruby.h... yes
checking for rb_intern_str() in ruby.h... yes
checking for rb_sym2str() in ruby.h... yes
checking for rb_str_intern() in ruby.h... yes
checking for rb_block_lambda() in ruby.h... yes
checking for rb_hash_dup() in ruby.h... yes
checking for rb_hash_clear() in ruby.h... yes
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-1sctzt8.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/msgpack-1.2.4 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/msgpack-1.2.4/gem_make.out

An error occurred while installing msgpack (1.2.4), and Bundler cannot continue.
Make sure that `gem install msgpack -v '1.2.4' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
bootsnap was resolved to 1.3.2, which depends on
msgpack

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/byebug-10.0.2/ext/byebug
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-1k33103.rb extconf.rb
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-1k33103.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/byebug-10.0.2 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/byebug-10.0.2/gem_make.out

An error occurred while installing byebug (10.0.2), and Bundler cannot continue.
Make sure that `gem install byebug -v '10.0.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
byebug

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/ffi-1.9.25/ext/ffi_c
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-3rmm35.rb extconf.rb
checking for ffi_call() in -lffi... yes
checking for ffi_closure_alloc()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
checking for shlwapi.h... no
checking for ruby/thread.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-3rmm35.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/ffi-1.9.25 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/ffi-1.9.25/gem_make.out

An error occurred while installing ffi (1.9.25), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.25' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
selenium-webdriver was resolved to 3.14.0, which depends on
childprocess was resolved to 0.9.0, which depends on
ffi

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/mysql2-0.5.2/ext/mysql2
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-1l23279.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes
-----
Using mysql_config at /usr/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... no
checking for MYSQL_OPT_SSL_ENFORCE in mysql.h... no
checking for MYSQL.net.vio in mysql.h... yes
checking for MYSQL.net.pvio in mysql.h... no
checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes
checking for my_bool in mysql.h... yes
-----
Setting libpath to /usr/lib64/mysql
-----
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-1l23279.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/mysql2-0.5.2 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/mysql2-0.5.2/gem_make.out

An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
mysql2

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/puma-3.12.0/ext/puma_http11
/home/vagrant/.rbenv/versions/2.4.1/bin/ruby -r ./siteconf20181019-17692-p58zim.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
creating Makefile

Text file busy @ unlink_internal - ./siteconf20181019-17692-p58zim.rb

Gem files will remain installed in /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/gems/puma-3.12.0 for inspection.
Results logged to /var/www/html/imakoko/appname/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0-static/puma-3.12.0/gem_make.out

An error occurred while installing puma (3.12.0), and Bundler cannot continue.
Make sure that `gem install puma -v '3.12.0' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
puma
[/shell]

nokogiriをyumでインストールしたり、gemでインストールしたりしたがダメだった。
調べてるとvagrantを使っていて、synced folderを使っているディレクトリにインストールしようとすると失敗することが多い模様

[shell]
[vagrant@vagrant-centos65 appname]$ mkdir -p /home/vagrant/bundle/appname
[vagrant@vagrant-centos65 appname]$ bundle install --path /home/vagrant/bundle/appname
[/shell]

 - ruby&rails ,