need help to install Nokogiri

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

Thanks

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]https://github.com/sparklemotion/nokogiri#requirements

Carlos Mathiasen 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?

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

Colin Law wrote in post #1107182:

Are you running Rails? If so which version?

Colin

Colin Law wrote in post #1107190:

Have you worked through a good tutorial such as 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

Carlos Mathiasen 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:~$

Carlos Mathiasen 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

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

Colin

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 >

Just to give you a heads up for next time: curl -L [https://get.rvm.io](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/wayneeseguin/rvm/blob/master/scripts/functions/requirements/ubuntu#L83

Jordon Bedwell wrote in post #1107360:

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:

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

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