Require Nokogiri? There is no such file to download

I am trying to start using Nokogiri. I executed the command

gem install nokogiri 

as an administrator on Windows 7 (64-bit). The console is "successfully installed" and "1 stone is installed."

When i type

 gem list --local OR gem q --local 

I see Nokogiri in the Local Gems list.

However, when I try to use it through the require statement (in NetBeans), I get the error message "there is no such file to load."

What am I doing wrong? I am not a Ruby professional. This is also the first stone I installed. Please leave it to me.

+7
source share
4 answers

Netbeans comes with built-in jRuby.

You can specify or check the version of Ruby that is currently used in your project in the project properties (high-light section).

enter image description here

+4
source

With Ruby 1.8, you need to require 'rubygems' before you need libraries installed as gems. With Ruby 1.9, this is no longer necessary.

 require 'rubygems' require 'nokogiri' ... 
+21
source

I understand that this post is quite old, but others may stumble here with the same problem as me. Newcomers like me may not understand that

 require 'rubygems' 

must precede

 require 'nokogiri' 

At least based on another url that gave me this idea, adding this line solved the problem for me with nokogiri.

+8
source

I struggled with this for a while, updating Ruby 2.0.

It was fixed to install nokigiri using apt-get

 apt-get install ruby-nokogiri 

As dependencies of third-party notes can be seen using

 $ gem dependency nokogiri Gem nokogiri-1.6.1 hoe (~> 3.7, development) hoe-bundler (>= 1.1, development) hoe-debugging (>= 1.0.3, development) hoe-gemspec (>= 1.0, development) hoe-git (>= 1.4, development) mini_portile (~> 0.5.0) minitest (~> 2.2.2, development) racc (>= 1.4.6, development) rake (>= 0.9, development) rake-compiler (~> 0.8.0, development) rdoc (~> 4.0, development) rexical (>= 1.0.5, development) 
+2
source

All Articles