[WSL Ubuntu] [?Bug?] Nokogiri hangs bundle install

809 views
Skip to first unread message

Ilya Zarembsky

unread,
Feb 3, 2018, 5:24:03 PM2/3/18
to nokogiri-talk
Hi everyone :) 

I'm often needing to bundle install earlier versions of Nokogiri (e.g. 1.6.8) as part of working through web dev labs at the Flatiron School.

Sadly, the bundle install process hangs once it gets to Nokogiri and reports that Nokogiri is building native extensions.

Googling learned me that Nokogiri sometimes does take a long time to build these as it tries to compile libxml2 and/or libxslt by default (?). 

But, I'm not talking about a few minutes. I'm talking about - it's still hanging after 2-3 hours.

I'm on WSL Ubuntu. I have not had this problem with any other gems.

Has anyone encountered similar issue?


Mike Dalessio

unread,
Feb 3, 2018, 5:28:35 PM2/3/18
to nokogiri-talk
Hi,

Can you provide information about your operating system, version of ruby, version of compiler, etc.? It's easier to diagnose what you're seeing if someone can reproduce it.

As an aside, you can avoid compiling many libraries by using your machine's system libraries. See this section of the installation tutorial for more information:


Hope this helps,
-m


--
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nokogiri-talk+unsubscribe@googlegroups.com.
To post to this group, send email to nokogi...@googlegroups.com.
Visit this group at https://groups.google.com/group/nokogiri-talk.
For more options, visit https://groups.google.com/d/optout.

Ilya Zarembsky

unread,
Feb 6, 2018, 9:51:43 PM2/6/18
to nokogiri-talk
Hi Mike!

Thank you for taking the time to respond :)

System info:

OS: 
Windows 10 Home v1709 build 16299.192 running
Ubuntu 16.04.3 LTS Xenial through the Windows Subsystem Linux & the Ubuntu app in the Windows store.

ruby -v: 
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

bundle -v:
Bundler version 1.16.1

gcc -v: 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)

----------------------

I was just able to reproduce the issue when trying to run bundle install in a repo that has Nokogiri 1.6.6.2 in Gemfile.lock. This is the repo: https://github.com/learn-co-students/sinatra-views-lab-v-000

I tried installing with system libraries again, as per your suggestion. Following the instructions at the link you provided, I executed the following in the root dir of a local clone* of the above repo:

bundle config build.nokogiri --use-system libraries
bundle install

This produced the following error:
"current directory: /home/wlycdgr/.rvm/gems/ruby-2.3.3/gems/nokogiri-1.6.6.2/ext/nokogiri
/home/wlycdgr/.rvm/rubies/ruby-2.3.3/bin/ruby -r ./siteconf20180206-4852-d1l3dk.rb extconf.rb --use-system-libraries
checking if the C compiler accepts ... yes
Building nokogiri using system libraries.
libxml2 version 2.6.21 or later is required!
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers....."

However, sudo apt install libxml2
outputs
"libxml2 is already the newest version (2.9.3+dfsg1-1ubuntu0.5)."

apt list libxml2 confirms this:
libxml2/xenial-updates,xenial-security,now 2.9.3+dfsg1-1ubuntu0.5 amd64 [installed]
libxml2/xenial 2.9.3+dfsg1-1 amd64

* the repo dir resides on the Windows filesystem, mounted in the Ubuntu app at /mnt/c/.....

Please let me know ifandwhat additional details would be helpful.

Thank you again for your help - 

Cheers,
Ilya

On Saturday, February 3, 2018 at 5:28:35 PM UTC-5, Mike Dalessio wrote:
Hi,

Can you provide information about your operating system, version of ruby, version of compiler, etc.? It's easier to diagnose what you're seeing if someone can reproduce it.

As an aside, you can avoid compiling many libraries by using your machine's system libraries. See this section of the installation tutorial for more information:


Hope this helps,
-m

On Sat, Feb 3, 2018 at 12:04 AM, Ilya Zarembsky <ilya.za...@gmail.com> wrote:
Hi everyone :) 

I'm often needing to bundle install earlier versions of Nokogiri (e.g. 1.6.8) as part of working through web dev labs at the Flatiron School.

Sadly, the bundle install process hangs once it gets to Nokogiri and reports that Nokogiri is building native extensions.

Googling learned me that Nokogiri sometimes does take a long time to build these as it tries to compile libxml2 and/or libxslt by default (?). 

But, I'm not talking about a few minutes. I'm talking about - it's still hanging after 2-3 hours.

I'm on WSL Ubuntu. I have not had this problem with any other gems.

Has anyone encountered similar issue?


--
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nokogiri-tal...@googlegroups.com.

Mike Dalessio

unread,
Feb 7, 2018, 7:20:17 AM2/7/18
to nokogiri-talk
Ah, you're running the Linux thing on Windows ... I don't know that we've ever tried to make that work. Let's do this.

First, let's please start with a modern version of Nokogiri. That will tell us whether it's potentially a problem with a specific version of Nokogiri on this platform.

Can you please run `gem install nokogiri --verbose`? If that fails, please send
  • the output from the build
  • the mkmf.log file (you may need to hunt for this, will be something like gems/ruby-2.4.1/gems/nokogiri-1.8.2/ext/nokogiri/mkmf.log
  • if it fails during building libxml2 or libxslt, please send any log files from the build directory, something like gems/ruby-2.4.1/gems/nokogiri-1.8.2/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.7/*.log
you may also want to give feedback to the owner of that repo to update their dependencies. ;-)

To unsubscribe from this group and stop receiving emails from it, send an email to nokogiri-talk+unsubscribe@googlegroups.com.

Ilya Zarembsky

unread,
Feb 7, 2018, 7:09:01 PM2/7/18
to nokogiri-talk
I first ran "gem list nokogiri" to capture state before running install. 1.8.1 was installed.
I then ran "gem install nokogiri --verbose" as per your instructions, which took about an hour, but did succeed.
I then ran "gem list nokogiri" again. Now, 1.8.2 is also listed as installed, along with 1.8.1.

I am attaching the related console output.

Thank you for your help, Mike -

Cheers,
Ilya
gem_install_nokogiri_--verbose_OUTPUT.txt
gem_list_nokogiri_afterInstall_OUTPUT.txt
gem_list_nokogiri_OUTPUT.txt

Ilya Zarembsky

unread,
Feb 10, 2018, 6:49:41 PM2/10/18
to nokogiri-talk
(Neglected to add - this did not alter the bundle install behavior. Bundle install still hangs in the same way. Trying to install using system libraries still produces the same error).
Reply all
Reply to author
Forward
0 new messages