Error installing Nokogiri? mini_portile unavailable?

My local gem list

bundler (1.6.0)
childprocess (0.5.1)
ffi (1.9.3)
headless (1.0.1)
json (1.8.1)
mini_portile (0.5.3, 0.5.2)
minitest (5.3.1)
multi_json (1.9.0)
rake (10.2.2)
rdoc (4.1.1)
rubyzip (1.1.2)
selenium-webdriver (2.41.0, 2.40.0)
watir-webdriver (0.6.8)
websocket (1.0.7, 1.0.4)

I also installed libxml2 and libxslt. He says that he cannot load mini_portile gem, but he appears in the local gem list.

Also I cannot sudo since I do not have root privileges.

Error message

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

        /usr/bin/ruby1.9.1 extconf.rb
*** 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=/usr/bin/ruby1.9.1
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mini_portile (LoadError)
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from extconf.rb:92:in `<main>'


Gem files will remain installed in /home/jotsarup/.gem/gems/nokogiri-1.6.1 for inspection.
Results logged to /home/jotsarup/.gem/gems/nokogiri-1.6.1/ext/nokogiri/gem_make.out
+4
source share
2 answers

Try setting the nokogiri requirements first if u uses Ubuntu.

sudo apt-get install libxslt-dev libxml2-dev
sudo gem install nokogiri

other wise follow this link to Install Nokogiri

+2
source

Also try setting GEM_HOME to an absolute path as follows:

GEM_HOME=$(pwd)/.gem gem1.9.3 install nokogiri

GEM_HOME .

0

Source: https://habr.com/ru/post/1534323/


All Articles