Error installing on Ubuntu with chruby

93 views
Skip to first unread message

bra...@developish.com

unread,
Dec 18, 2014, 4:00:54 PM12/18/14
to nokogi...@googlegroups.com
With:

• Using chruby at /opt/rubies/ruby-2.1.5/bin/ruby
• Ruby 2.1.5
• On a vagrant virtual machine.
• ruby-dev is installed

Having the following error, but I don't know how to debug it:

----

Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
        ERROR: Failed to build gem native extension.

    /opt/rubies/ruby-2.1.5/bin/ruby extconf.rb
/opt/rubies/ruby-2.1.5/bin/ruby: invalid option -2  (-h will show valid options) (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in /home/vagrant/.gem/ruby/2.1.5/gems/nokogiri-1.6.5 for inspection.
Results logged to /home/vagrant/.gem/ruby/2.1.5/extensions/x86_64-linux/2.1.0-static/nokogiri-1.6.5/gem_make.out

Adam Dullenty

unread,
Dec 19, 2014, 10:37:44 AM12/19/14
to nokogi...@googlegroups.com
FYI seems similar to an issue I was seeing (also with chruby) on Mac, I created a separate thread earlier:

https://groups.google.com/forum/#!topic/nokogiri-talk/vDcGn-wcad8

Maybe the fact I was doing this on Mac was a bit of a red herring.

Cheers,
Adam

Mike Dalessio

unread,
Dec 28, 2014, 1:33:57 PM12/28/14
to nokogiri-talk
Can you please send your gem_make.out file? Also any additional information about your gcc version would probably be helpful.


--
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.
To post to this group, send email to nokogi...@googlegroups.com.
Visit this group at http://groups.google.com/group/nokogiri-talk.
For more options, visit https://groups.google.com/d/optout.

Álvaro Reig González

unread,
Jan 7, 2015, 10:54:57 AM1/7/15
to nokogi...@googlegroups.com
Hi Mike,

I am having exactly the same problem. My environment is:

  • Linux Mint 17 amd64
  • ruby-install 0.5.0
  • chruby 0.3.9


I tried "gem install nokogiri" and the output was:

-----------
Building native extensions.  This could take a while...
ERROR:  Error installing nokogiri:
ERROR: Failed to build gem native extension.

    /home/areig/.rubies/ruby-2.1.3/bin/ruby extconf.rb
/home/areig/.rubies/ruby-2.1.3/bin/ruby: invalid option -2  (-h will show valid options) (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in /home/areig/.gem/ruby/2.1.3/gems/nokogiri-1.6.5 for inspection.
Results logged to /home/areig/.gem/ruby/2.1.3/extensions/x86_64-linux/2.1.0-static/nokogiri-1.6.5/gem_make.out
------------

I have attached the gem_make.out. If I list dpkg -l |grep gcc I got:

----------
ii  gcc                                                         4:4.8.2-1ubuntu6                                    amd64        GNU C compiler
ii  gcc-4.8                                                     4.8.2-19ubuntu1                                     amd64        GNU C compiler
ii  gcc-4.8-base:amd64                                          4.8.2-19ubuntu1                                     amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-4.8-base:i386                                           4.8.2-19ubuntu1                                     i386         GCC, the GNU Compiler Collection (base package)
ii  gcc-4.9-base:amd64                                          4.9.1-0ubuntu1                                      amd64        GCC, the GNU Compiler Collection (base package)
ii  gcc-4.9-base:i386                                           4.9.1-0ubuntu1                                      i386         GCC, the GNU Compiler Collection (base package)
ii  libgcc-4.8-dev:amd64                                        4.8.2-19ubuntu1                                     amd64        GCC support library (development files)
ii  libgcc1:amd64                                               1:4.9.1-0ubuntu1                                    amd64        GCC support library
ii  libgcc1:i386                                                1:4.9.1-0ubuntu1                                    i386         GCC support library
----------

I have already installed all the libraries  ( libxslt-dev libxml2-dev libxml2 ) and got the same results.

I hope  this information will be helpful. Thanks,
gem_make.out

Mike Dalessio

unread,
Jan 12, 2015, 8:47:23 AM1/12/15
to nokogi...@googlegroups.com
I believe this the same issue as reported in #1210


Please follow that issue for updates.

Álvaro Reig González

unread,
Jan 16, 2015, 4:56:23 AM1/16/15
to nokogi...@googlegroups.com
Hi Mike,

What solved the problem for me was:

( apt-get install libxslt-dev libxml2-dev libxml2 )
gem install nokogiri -- --use-system-libraries


Thanks, regards, 
Reply all
Reply to author
Forward
0 new messages