Require Nokogiri? No such file to load

夙愿已清 提交于 2019-12-05 07:09:29

Netbeans comes with built-in jRuby.

You can specify or check wich version of ruby currently used in your project in project's properties (higlighted section).

With Ruby 1.8, you have to require 'rubygems' before requiring any libraries installed as gems. With Ruby 1.9, that is not necessary anymore.

require 'rubygems'
require 'nokogiri'
...
Sid

I realize this post is pretty old, but others may stumble here with the same problem, as I did. Novices like me may not realize that

require 'rubygems' 

must precede

require 'nokogiri'

At least, based on another URL post that gave me the idea, the addition of that line solved the problem for me with nokogiri.

I was struggling with this one for a while, having upgraded to ruby 2.0.

The fix was to install nokigiri using apt-get

apt-get install ruby-nokogiri

As a side note dependencies 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)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!