kavyasukumar / annotations-app

3 stars 2 forks source link

bundle instal issue with` nokogiri` #1

Open pietrop opened 7 years ago

pietrop commented 7 years ago

Hey @kavyasukumar

I run into a problem when trying this out.

$ bundle install
Warning: the running version of Bundler (1.15.0) is older than the version that created the lockfile (1.15.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from http://rubygems.org/...........
Fetching version metadata from http://rubygems.org/...
Fetching dependency metadata from http://rubygems.org/..
Fetching https://github.com/ryanmark/middleman.git
Fetching https://github.com/ryanmark/middleman-sprockets.git
Fetching https://github.com/ryanmark/foundation-sass.git
Fetching rake 12.0.0
Installing rake 12.0.0
Fetching coffee-script-source 1.12.2
Installing coffee-script-source 1.12.2
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching chunky_png 1.3.8
Installing chunky_png 1.3.8
Fetching multi_json 1.12.1
Installing multi_json 1.12.1
Fetching sass 3.4.23
Installing sass 3.4.23
Fetching rb-fsevent 0.9.8
Installing rb-fsevent 0.9.8
Fetching ffi 1.9.17
Installing ffi 1.9.17 with native extensions
Fetching tilt 1.4.1
Installing tilt 1.4.1
Fetching kramdown 1.13.2
Installing kramdown 1.13.2
Fetching i18n 0.7.0
Installing i18n 0.7.0
Fetching json 1.8.6
Installing json 1.8.6 with native extensions
Fetching minitest 5.10.1
Installing minitest 5.10.1
Fetching thread_safe 0.3.5
Installing thread_safe 0.3.5
Fetching mime-types 2.99.3
Installing mime-types 2.99.3
Fetching mini_portile2 2.1.0
Installing mini_portile2 2.1.0
Fetching rack 1.6.5
Installing rack 1.6.5
Fetching erubis 2.7.0
Installing erubis 2.7.0
Fetching uber 0.0.15
Installing uber 0.0.15
Fetching thor 0.19.4
Installing thor 0.19.4
Using bundler 1.15.0
Fetching hike 1.2.3
Installing hike 1.2.3
Fetching eventmachine 1.2.1
Installing eventmachine 1.2.1 with native extensions
Fetching http_parser.rb 0.6.0
Installing http_parser.rb 0.6.0 with native extensions
Fetching archieml 0.3.0
Installing archieml 0.3.0
Fetching public_suffix 2.0.5
Installing public_suffix 2.0.5
Fetching extlib 0.9.16
Installing extlib 0.9.16
Fetching multipart-post 2.0.0
Installing multipart-post 2.0.0
Fetching jwt 1.5.6
Installing jwt 1.5.6
Fetching retriable 1.4.1
Installing retriable 1.4.1
Fetching uuidtools 2.1.5
Installing uuidtools 2.1.5
Fetching rubyzip 1.2.0
Installing rubyzip 1.2.0
Fetching ruby-thumbor 2.0.1
Installing ruby-thumbor 2.0.1
Fetching ruby-oembed 0.10.1
Installing ruby-oembed 0.10.1
Fetching rdiscount 2.2.0.1
Installing rdiscount 2.2.0.1 with native extensions
Fetching ejs 1.1.1
Installing ejs 1.1.1
Fetching crass 1.0.2
Installing crass 1.0.2
Fetching rubypants 0.6.0
Installing rubypants 0.6.0
Using foundation-sass 5.5.3 from https://github.com/ryanmark/foundation-sass.git (at master@1e2e231)
Fetching coderay 1.1.1
Installing coderay 1.1.1
Fetching method_source 0.8.2
Installing method_source 0.8.2
Fetching slop 3.6.0
Installing slop 3.6.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Fetching compass-core 1.0.3
Installing compass-core 1.0.3
Fetching compass-import-once 1.0.5
Installing compass-import-once 1.0.5
Fetching rb-inotify 0.9.7
Installing rb-inotify 0.9.7
Fetching haml 4.0.7
Installing haml 4.0.7
Fetching uglifier 2.7.2
Installing uglifier 2.7.2
Fetching tzinfo 1.2.2
Installing tzinfo 1.2.2
Fetching nokogiri 1.7.0.1
Installing nokogiri 1.7.0.1 with native extensions
Fetching rack-test 0.6.3
Installing rack-test 0.6.3
Fetching rack-livereload 0.3.16
Installing rack-livereload 0.3.16
Fetching hooks 0.4.1
Installing hooks 0.4.1
Fetching sprockets 2.12.4
Installing sprockets 2.12.4
Fetching em-websocket 0.5.1
Installing em-websocket 0.5.1
Fetching addressable 2.5.0
Installing addressable 2.5.0
Fetching faraday 0.10.1
Installing faraday 0.10.1
Fetching pry 0.10.4
Installing pry 0.10.4
Fetching compass 1.0.3
Installing compass 1.0.3
Fetching listen 3.0.8
Installing listen 3.0.8
Fetching activesupport 4.2.7.1
Installing activesupport 4.2.7.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/pietropassarelli/.rbenv/versions/2.2.2/bin/ruby -r
./siteconf20170730-1809-1pce2p8.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts
-Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:

Building Nokogiri with a packaged version of libxml2-2.9.4.

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.4.tar.gz into
tmp/x86_64-apple-darwin14.5.0/ports/libxml2/2.9.4... OK
Running 'configure' for libxml2 2.9.4... OK
Running 'compile' for libxml2 2.9.4... ERROR, review
'/Users/pietropassarelli/Desktop/annotations-app/.bundle/gems/nokogiri-1.7.0.1/ext/nokogiri/tmp/x86_64-apple-darwin14.5.0/ports/libxml2/2.9.4/compile.log'
to see what happened. Last lines are:
========================================================================
    unsigned short* in = (unsigned short*) inb;
                         ^~~~~~~~~~~~~~~~~~~~~
encoding.c:815:27: warning: cast from 'unsigned char *' to 'unsigned short *'
increases required alignment from 1 to 2 [-Wcast-align]
    unsigned short* out = (unsigned short*) outb;
                          ^~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
  CC       error.lo
  CC       parserInternals.lo
  CC       parser.lo
  CC       tree.lo
  CC       hash.lo
  CC       list.lo
  CC       xmlIO.lo
xmlIO.c:1450:52: error: use of undeclared identifier 'LZMA_OK'
    ret =  (__libxml2_xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1;
                                                   ^
1 error generated.
make[2]: *** [xmlIO.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
========================================================================
*** 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=/Users/pietropassarelli/.rbenv/versions/2.2.2/bin/$(RUBY_BASE_NAME)
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build
/Users/pietropassarelli/Desktop/annotations-app/.bundle/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:366:in
`block in execute': Failed to complete compile task (RuntimeError)
from
/Users/pietropassarelli/Desktop/annotations-app/.bundle/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in
`chdir'
from
/Users/pietropassarelli/Desktop/annotations-app/.bundle/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in
`execute'
from
/Users/pietropassarelli/Desktop/annotations-app/.bundle/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:111:in
`compile'
from
/Users/pietropassarelli/Desktop/annotations-app/.bundle/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:150:in
`cook'
    from extconf.rb:364:in `block (2 levels) in process_recipe'
    from extconf.rb:257:in `block in chdir_for_build'
    from extconf.rb:256:in `chdir'
    from extconf.rb:256:in `chdir_for_build'
    from extconf.rb:363:in `block in process_recipe'
    from extconf.rb:262:in `tap'
    from extconf.rb:262:in `process_recipe'
    from extconf.rb:547:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in
/Users/pietropassarelli/Desktop/annotations-app/.bundle/gems/nokogiri-1.7.0.1
for inspection.
Results logged to
/Users/pietropassarelli/Desktop/annotations-app/.bundle/extensions/x86_64-darwin-14/2.2.0-static/nokogiri-1.7.0.1/gem_make.out

An error occurred while installing nokogiri (1.7.0.1), and Bundler
cannot continue.
Make sure that `gem install nokogiri -v '1.7.0.1'` succeeds before
bundling.

In Gemfile:
  middleman was resolved to 3.4.1, which depends on
    middleman-sprockets was resolved to 3.4.3, which depends on
      middleman-core was resolved to 3.4.1, which depends on
        capybara was resolved to 2.4.4, which depends on
          xpath was resolved to 2.0.0, which depends on
            nokogiri

then when I run

$ bundle exec middleman
Could not find nokogiri-1.7.0.1 in any of the sources
Run `bundle install` to install missing gems.

also tried gem install nokogiri -v '1.7.0.1' but no luck, any ideas what could could be causing this?

pietrop commented 7 years ago

I tried with a new middleman project, and get the same issue, so might be an issue with middlerman or with my ruby setup.

This is what I got when trying therbenv setup from the README.

$ brew install ruby-build rbenv
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (caskroom/cask).
No changes to formulae.

Warning: ruby-build 20170726 is already installed
Warning: rbenv 1.1.1 is already installed
$ rbenv install 2.2.5
ruby-build: use openssl from homebrew
Downloading ruby-2.2.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.5.tar.bz2
error: failed to download ruby-2.2.5.tar.bz2

BUILD FAILED (OS X 10.12.5 using ruby-build 20170726)
$ rbenv global 2.2.5
rbenv: version `2.2.5' not installed
$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]