devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

Bundle install does not work with ruby 2.6.5, need to backtrack to 2.5.0

Open acezalba opened this issue 5 years ago • 0 comments

After encountering errors with devdocs.io/offline (most docs return an error upon install), I've decided to build the site offline. However, after cloning, running bundle install will result in the following error, caused by the typhoeus gem depending on a noncompiling ffi:

 current directory: /home/ghost/.rvm/gems/ruby-2.6.5/gems/ffi-1.11.1/ext/ffi_c
/home/ghost/.rvm/rubies/ruby-2.6.5/bin/ruby -I /home/ghost/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200412-14810-s67kws.rb extconf.rb
--enable-system-libffi
*** 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=/home/ghost/.rvm/rubies/ruby-2.6.5/bin/$(RUBY_BASE_NAME)
	--with-ffi_c-dir
	--without-ffi_c-dir
	--with-ffi_c-include
	--without-ffi_c-include=${ffi_c-dir}/include
	--with-ffi_c-lib
	--without-ffi_c-lib=${ffi_c-dir}/lib
	--enable-system-libffi
	--with-libffi-config
	--without-libffi-config
	--with-pkg-config
	--without-pkg-config
/home/ghost/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /home/ghost/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:552:in `try_link0'
	from /home/ghost/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
	from /home/ghost/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:672:in `try_ldflags'
	from /home/ghost/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:1832:in `pkg_config'
	from extconf.rb:9:in `system_libffi_usable?'
	from extconf.rb:36:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/ghost/.rvm/gems/ruby-2.6.5/extensions/x86_64-linux/2.6.0/ffi-1.11.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/ghost/.rvm/gems/ruby-2.6.5/gems/ffi-1.11.1 for inspection.
Results logged to /home/ghost/.rvm/gems/ruby-2.6.5/extensions/x86_64-linux/2.6.0/ffi-1.11.1/gem_make.out

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

In Gemfile:
  typhoeus was resolved to 1.3.1, which depends on
    ethon was resolved to 0.12.0, which depends on
      ffi

After much trial and error, the problem can be traced to a similar issue in https://github.com/ffi/ffi/issues/719, where ffi does not compile with 2.6.5 and above. Changing the ruby version in the gemfile to 2.5.0 resolved the problem.

acezalba avatar Apr 12 '20 05:04 acezalba