# Need help to install Nokogiri

**URL:** <https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576>\
**Category:** Rails\
**Created:** [April 28, 2013, 9:43pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576 "2013-04-28T21:43:11Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 28, 2013, 9:43pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/1 "2013-04-28T21:43:11Z")

</div>

Hi,

I am using Ubuntu13.04. I have installed Ruby2.0 using RVM. But now  
looking for any guideline to install nokogiri and selenium-webdriver.  
But not found any concrete step by step instructions to install the same  
using RVM. can anyone out there help me.

I have installed Ruby using the link:  
[https://gist.github.com/pcjpcj2/5443017](https://gist.github.com/pcjpcj2/5443017)

Thanks

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 28, 2013, 11:26pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/2 "2013-04-28T23:26:51Z")

</div>

Nokogiri is a gem, them you only need

gem install nokogiri

but first you need install this libraries for ubuntu[0]:

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

[0][GitHub - sparklemotion/nokogiri: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.](https://github.com/sparklemotion/nokogiri#requirements)

Matt’s

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 6:47am UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/3 "2013-04-29T06:47:26Z")

</div>

Carlos M. wrote in post #1107144:

> Nokogiri is a gem, them you only need
> 
> gem install nokogiri
> 
> but first you need install this libraries for ubuntu[0]:
> 
> sudo apt-get install libxml2 libxml2-dev libxslt libxslt-dev

As I installed Ruby using RVM, I thought I need to install everything  
using RVM. So if I do `sudo` to install nokogiri then will it work?

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 9:12am UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/4 "2013-04-29T09:12:01Z")

</div>

On 29 April 2013 05:47, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> using RVM. So if I do `sudo` to install nokogiri then will it work?  
> If using rvm you must /not/ use sudo when installing gems. However  
> you should not need to install it manually, just put it in Gemfile for  
> the application and bundle install will automatically install it. You  
> do need sudo for installing the libxml stuff of course.

Colin

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 9:35am UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/5 "2013-04-29T09:35:25Z")

</div>

On 29 April 2013 08:26, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks for your reply! I am new to Ubuntu. I am basically worked on  
> windows,where only “gem install nokogiri” worked. But in Linux things  
> are little bit fancy.
> 
> Thus I need a step by step installation help. Could you? I also gave the  
> link in the first post from where I downloaded the Ruby just as FYI.

Are you running Rails? If so which version?

Colin

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 9:26am UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/6 "2013-04-29T09:26:04Z")

</div>

Colin L. wrote in post #1107182:

> On 29 April 2013 05:47, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > using RVM. So if I do `sudo` to install nokogiri then will it work?  
> > If using rvm you must /not/ use sudo when installing gems. However  
> > you should not need to install it manually, just put it in Gemfile for  
> > the application and bundle install will automatically install it. You  
> > do need sudo for installing the libxml stuff of course.

> Colin

Thanks for your reply! I am new to Ubuntu. I am basically worked on  
windows,where only “gem install nokogiri” worked. But in Linux things  
are little bit fancy.

Thus I need a step by step installation help. Could you? I also gave the  
link in the first post from where I downloaded the Ruby just as FYI.

Please help.

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 11:25am UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/7 "2013-04-29T11:25:50Z")

</div>

On 29 April 2013 09:27, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Colin
> 
> I am using Rail 4.0. as the first post link is for Ruby2.0 and Rail 4.0  
> installation.

Have you worked through a good tutorial such as [railstutorial.org](http://railstutorial.org)  
(which is free to use online)? That will show you the basics,  
including how to use the Gemfile to control the gems you want. I  
think railstutorial has a beta version of the tutorial for rails 4.  
You do realise, I presume, that rails 4 is not released yet so you may  
well come across problems. Make sure that you use the correct version  
of rails for any tutorial that you use. With rvm is not a problem to  
have multiple versions of rails (and ruby) installed, of course.

Colin

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 10:27am UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/8 "2013-04-29T10:27:17Z")

</div>

Colin L. wrote in post #1107190:

> On 29 April 2013 08:26, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > Thanks for your reply! I am new to Ubuntu. I am basically worked on  
> > windows,where only “gem install nokogiri” worked. But in Linux things  
> > are little bit fancy.
> > 
> > Thus I need a step by step installation help. Could you? I also gave the  
> > link in the first post from where I downloaded the Ruby just as FYI.
> 
> Are you running Rails? If so which version?
> 
> Colin

I am using Rail 4.0. as the first post link is for Ruby2.0 and Rail 4.0  
installation.

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 7:08pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/9 "2013-04-29T19:08:24Z")

</div>

Carlos M. wrote in post #1107144:

> Nokogiri is a gem, them you only need
> 
> gem install nokogiri
> 
> but first you need install this libraries for ubuntu[0]:
> 
> sudo apt-get install libxml2 libxml2-dev libxslt libxslt-de

Tried but got error:

kirti@kirti-Aspire-5733Z:~$ sudo apt-get install libxml2 libxml2-dev  
libxslt libxslt-dev  
[sudo] password for kirti:  
Reading package lists… Done  
Building dependency tree  
Reading state information… Done  
Note, selecting ‘libxslt1-dev’ instead of ‘libxslt-dev’  
E: Unable to locate package libxslt  
kirti@kirti-Aspire-5733Z:~$

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 8:31pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/10 "2013-04-29T20:31:31Z")

</div>

On 29 April 2013 18:08, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> kirti@kirti-Aspire-5733Z:~$ sudo apt-get install libxml2 libxml2-dev  
> libxslt libxslt-dev  
> [sudo] password for kirti:  
> Reading package lists… Done  
> Building dependency tree  
> Reading state information… Done  
> Note, selecting ‘libxslt1-dev’ instead of ‘libxslt-dev’  
> E: Unable to locate package libxslt

You don’t need libxslt, which is lucky as it does not exist. Repeat  
the apt-get but leave out libxslt.

Colin

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 29, 2013, 9:24pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/11 "2013-04-29T21:24:04Z")

</div>

Finally i am done:

kirti@kirti-Aspire-5733Z:~$ sudo apt-get install libxml2-dev  
libxslt1-dev  
Reading package lists… Done  
Building dependency tree  
Reading state information… Done  
libxml2-dev is already the newest version.  
libxslt1-dev is already the newest version.  
The following package was automatically installed and is no longer  
required:  
vim-runtime  
Use ‘apt-get autoremove’ to remove it.  
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

kirti@kirti-Aspire-5733Z:~$ gem install nokogiri  
Fetching: nokogiri-1.5.9.gem (100%)  
Building native extensions. This could take a while…  
Successfully installed nokogiri-1.5.9  
Parsing documentation for nokogiri-1.5.9  
unable to convert “\x90” from ASCII-8BIT to UTF-8 for  
lib/nokogiri/nokogiri.so, skipping  
Installing ri documentation for nokogiri-1.5.9  
1 gem installed

kirti@kirti-Aspire-5733Z:~$ irb  
2.0.0p0 :001 \> require ‘nokogiri’  
=\> true  
2.0.0p0 :002 \>

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 30, 2013, 1:30pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/12 "2013-04-30T13:30:46Z")

</div>

On Mon, Apr 29, 2013 at 2:24 PM, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> kirti@kirti-Aspire-5733Z:~$ irb  
> 2.0.0p0 :001 \> require ‘nokogiri’  
> =\> true  
> 2.0.0p0 :002 \>

Just to give you a heads up for next time: `curl -L https://get.rvm.io|bash -s head --ruby=2.0.0 --autolibs=enabled` would  
have installed  
everything from libxml2 down to Git for you and installed Ruby 2.0.0 and  
Rails as well. You can see a list of what we install for you here:

> <https://github.com/rvm/rvm/blob/master/scripts/functions/requirements/ubuntu#L83>

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 30, 2013, 2:46pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/13 "2013-04-30T14:46:09Z")

</div>

On 30 April 2013 13:37, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> …  
> Thanks for your suggestions! Now I need to install selenium-webdriver  
> also.But I did `gem install selenium-webdriver`. But it seems not  
> installed. As when I am doing require `selenium-webdriver` giving me  
> load error.

Did you get any errors when you installed it?

What do you see if you do  
gem list selenium-webdriver

If it does not show it installed then try  
gem install selenium-webdriver  
again. If you still can’t get it to install post the result of the  
two commands here. Copy/Paste the text so we can check for typos.

Also post the result of the require command.

Colin

---

<div class="post-metadata">

**Author:** ![my-ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@my-ruby](https://www.ruby-forum.com/u/my-ruby)\
**Post date:** [April 30, 2013, 2:37pm UTC](https://www.ruby-forum.com/t/need-help-to-install-nokogiri/228576/14 "2013-04-30T14:37:19Z")

</div>

Jordon B. wrote in post #1107360:

> On Mon, Apr 29, 2013 at 2:24 PM, Love U Ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Just to give you a heads up for next time: `curl -L https://get.rvm.io|bash -s head --ruby=2.0.0 --autolibs=enabled` would  
> have installed  
> everything from libxml2 down to Git for you and installed Ruby 2.0.0 and  
> Rails as well. You can see a list of what we install for you here:

> <https://github.com/rvm/rvm/blob/master/scripts/functions/requirements/ubuntu#L83>

Thanks for your suggestions! Now I need to install selenium-webdriver  
also.But I did `gem install selenium-webdriver`. But it seems not  
installed. As when I am doing require `selenium-webdriver` giving me  
load error.

Can you suggest about this for `Ubuntu 13.04` OS?

Thanks
