I’ve been following the awesome Rails 3 tutorial by Michael Hartl at http://railstutorial.org/book. I highly recommend anyone wanting to learn Ruby or Rails (even some other languages thrown in as well) to go to this site and you will learn from a thoroughly professional free online gem of a book. I also recommend anyone who can, to purchase the PDF or hardcover that is being offered to show the appreciation for all the hard work put in to this by the author.
Anyway as I was working through Chapter 3 when setting up the initial gem file for bundler to install all the project’s dependencies I kept getting a screen full of errors. After reading the errors I noticed that the gem install was failing while installing the nokogiri package. After Googling as we all do I noticed on the Nokogiri web site that Ubuntu/Debian required two packages to install the nokogiri package. I was hesitant to install them through the normal apt-get packaging tool because I didn’t want the Ruby Version Manager setup to not be able to find the dependencies since the rubies I use through RVM are installed in my /home/me/.rvm directory. Well after installing the two dendencies the classic Debian/Ubuntu way I was pleasantly surprised that all was well and my gem installs were able to finish without a hitch allowing me to continue with the awesome tutorial.
The two packages needed on Ubuntu/Debian can be installed as follows:
sudo apt-get install libxslt-dev libxml2-dev
*the Nokogiri site has details for a fix without running the RVM setup, be careful not to follow as is on the site if you are using the tutorial as directed on the rails tutorial web site.
And as a reminder make sure RVM is setup as Michael instructs in the tutorial.
Just a few words of caution, when following the instructions for the setup at the beginning of the Rails tutorial be very careful to follow them word for word and with this dependency exception on Linux, everything else works as expected.