<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Reticularium - RoR</title>
  <id>tag:www.reticularium.com,2012:mephisto/ror</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://www.reticularium.com/feed/ror/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://www.reticularium.com/ror" rel="alternate" type="text/html"/>
  <updated>2011-06-04T21:58:13+02:00</updated>
  <entry xml:base="http://www.reticularium.com/">
    <author>
      <name>Igor</name>
    </author>
    <id>tag:www.reticularium.com,2011-06-04:1920</id>
    <published>2011-06-04T21:51:00+02:00</published>
    <updated>2011-06-04T21:58:13+02:00</updated>
    <category term="ERR"/>
    <category term="Linux"/>
    <category term="RoR"/>
    <category term="bash"/>
    <category term="recipe"/>
    <category term="ror"/>
    <category term="ruby"/>
    <link href="http://www.reticularium.com/2011/6/4/1920" rel="alternate" type="text/html"/>
    <title>Gem list -&gt; gem install conversion one-liner</title>
<content type="html">
            &lt;p&gt;Useful to sync gems across servers. Converts &lt;code&gt;gem list --local&lt;/code&gt; output to a bunch of &lt;code&gt;gem install&lt;/code&gt; commands. Rails related gems are removed from the initial list.&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;gem list --local | grep -v '\*' | grep -v ^$ | grep -v ^action | grep -v ^active | grep -v ^rails | grep -v ^rack | grep -v ^rake | sed 's|(|-v=|' | sed 's|)||' | sed 's|^\(.*\),|\1\n\1|' | sed 's|=.*[[:space:]]|=|' | sed 's|^|gem install |'&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
          </content>  </entry>
  <entry xml:base="http://www.reticularium.com/">
    <author>
      <name>Igor</name>
    </author>
    <id>tag:www.reticularium.com,2011-05-31:1359</id>
    <published>2011-05-31T12:28:00+02:00</published>
    <updated>2011-08-15T09:47:56+02:00</updated>
    <category term="ERR"/>
    <category term="Linux"/>
    <category term="RoR"/>
    <category term="binary distros"/>
    <category term="debian"/>
    <category term="gentoo"/>
    <category term="lfs"/>
    <category term="ubuntu"/>
    <link href="http://www.reticularium.com/2011/5/31/1359" rel="alternate" type="text/html"/>
    <title>Why Linux is a pain?</title>
<summary type="html">&lt;p&gt;In fact, it isn&#8217;t. Let me explain.&lt;/p&gt;


	&lt;p&gt;When you see the next time a complaint like this, note what exactly that complaint is related to. I mean operating system. I am sure you&#8217;ll find out that it&#8217;s some sort of binary distributives like Centos or Ubuntu. But &lt;strong&gt;they are not exactly Linux!&lt;/strong&gt; They are what they are: Linux-based operating systems distributable in binary form. You can&#8217;t refer to them as to Linux, because 1) Linux is a kernel, not an operation system, and 2) being a monolithic kernel, it&#8217;s supposed to be carefully configured and compiled natively for each system. And operating system (GNU), should be compiled against this kernel. And the whole toolchain, too.&lt;/p&gt;


	&lt;p&gt;You might say, well, why does it matter? Is there any difference?&lt;/p&gt;


	&lt;p&gt;Yes, there is, and it&#8217;s huge. Let me show you.&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;In fact, it isn&#8217;t. Let me explain.&lt;/p&gt;


	&lt;p&gt;When you see the next time a complaint like this, note what exactly that complaint is related to. I mean operating system. I am sure you&#8217;ll find out that it&#8217;s some sort of binary distributives like Centos or Ubuntu. But &lt;strong&gt;they are not exactly Linux!&lt;/strong&gt; They are what they are: Linux-based operating systems distributable in binary form. You can&#8217;t refer to them as to Linux, because 1) Linux is a kernel, not an operation system, and 2) being a monolithic kernel, it&#8217;s supposed to be carefully configured and compiled natively for each system. And operating system (GNU), should be compiled against this kernel. And the whole toolchain, too.&lt;/p&gt;


	&lt;p&gt;You might say, well, why does it matter? Is there any difference?&lt;/p&gt;


	&lt;p&gt;Yes, there is, and it&#8217;s huge. Let me show you.&lt;/p&gt;
&lt;p&gt;In fact, it isn&#8217;t. Let me explain.&lt;/p&gt;


	&lt;p&gt;When you see the next time a complaint like this, note what exactly that complaint is related to. I mean operating system. I am sure you&#8217;ll find out that it&#8217;s some sort of binary distributives like Centos or Ubuntu. But &lt;strong&gt;they are not exactly Linux!&lt;/strong&gt; They are what they are: Linux-based operating systems distributable in binary form. You can&#8217;t refer to them as to Linux, because 1) Linux is a kernel, not an operation system, and 2) being a monolithic kernel, it&#8217;s supposed to be carefully configured and compiled natively for each system. And operating system (GNU), should be compiled against this kernel. And the whole toolchain, too.&lt;/p&gt;


	&lt;p&gt;You might say, well, why does it matter? Is there any difference?&lt;/p&gt;


	&lt;p&gt;Yes, there is, and it&#8217;s huge. Let me show you.&lt;/p&gt;


	&lt;p&gt;There are several aspects of why binary distros are kind of compromizing the idea of &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt;/Linux: performance, security, manageability. Security part is pretty obvious: if you have an operating system that is not just binary compatible, but binary identical with millions of others, it is much easier to create a virus or rootkit infecting such systems. Creating virus for your unique system is just impossible: to create it, attacker needs access to your system. There is a chance of course that a virus will work on your particular system, and this chance is not very small, but attackers don&#8217;t want a chance, they rather distribute their product via certain binary distro related channels to be sure that it runs just fine on every system it gets into.&lt;/p&gt;


	&lt;p&gt;Performance is a long story. I&#8217;d like to get some proper benchmark results first, and I am going to get them. But this is for another article. In short, the more your hardware differs from the one binary distro packages are compiled on, and the more your usage scenario differs from some average scenario, the more performance difference you&#8217;ll get.&lt;/p&gt;


	&lt;p&gt;Manageability looks like the advantage of the binary approach. Pre-compiled software packages are easy to install (just download) and easy to manage via package management system. This is what I want to compare now: how much easier it is, if it is at all.&lt;/p&gt;


	&lt;p&gt;I am going to provide three detailed step-by-step algorithms for setting up a simple &lt;acronym title=&quot;Ruby on Rails&quot;&gt;ROR&lt;/acronym&gt; website on a freshly installed systems: Linux From Scratch&lt;sup&gt;&lt;a href=&quot;#fn1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;, Gentoo&lt;sup&gt;&lt;a href=&quot;#fn2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt; and Ubuntu&lt;sup&gt;&lt;a href=&quot;#fn3&quot;&gt;3&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;


	&lt;p&gt;So I am going to start from the point where I have a &lt;span class=&quot;caps&quot;&gt;ROR&lt;/span&gt; website copied over to a new server that has a newly installed operating system. This is a common situation: you have your new server just booted up and running and you are going to move your website over to the new server. To shorten the article, I assume that database is already prepared or located on another server. Neither I am going to describe &lt;span class=&quot;caps&quot;&gt;HTTP&lt;/span&gt; server related steps. All I need is to start the application. So the further steps basically are:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;install Ruby&lt;/li&gt;
		&lt;li&gt;install Rubygems&lt;/li&gt;
		&lt;li&gt;install Rails gem&lt;/li&gt;
		&lt;li&gt;check if the application starts (I&#8217;ll be using script/console for this)&lt;/li&gt;
		&lt;li&gt;fix problems, if any&lt;/li&gt;
	&lt;/ol&gt;


	&lt;h4&gt;Pure &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt;/Linux&lt;/h4&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;12&lt;tt&gt;
&lt;/tt&gt;13&lt;tt&gt;
&lt;/tt&gt;14&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;15&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;16&lt;tt&gt;
&lt;/tt&gt;17&lt;tt&gt;
&lt;/tt&gt;18&lt;tt&gt;
&lt;/tt&gt;19&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;21&lt;tt&gt;
&lt;/tt&gt;22&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;Download the source code tarball of required version from ruby-lang.org:&lt;tt&gt;
&lt;/tt&gt;wget ftp://ftp.ruby-lang.org/pub/xxxxxx&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;(if you don't know a certain software download site, Google is your friend, with opensource &lt;tt&gt;
&lt;/tt&gt;software it's never a problem to find the site and get the download link)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;Unpack:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;tar xf &amp;lt;tarball&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;cd to directory and run:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;./configure --help&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;this command shows all available options, I consider three of them needed:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;./configure --prefix=/usr --enable-shared --enable-pthread&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;Now compile and install:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;make&lt;tt&gt;
&lt;/tt&gt;make install&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Now I need Rubygems:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;Download it using the link provided on http://rubyonrails.org/download&lt;tt&gt;
&lt;/tt&gt;Unpack, cd to its directory and run:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;ruby setup.rb&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;And finally Rails of required version:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;gem install rails -v &amp;lt;version&amp;gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Now I can switch to the directory where my website is located and run:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;script/console&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;It says there are missing gems. It&#8217;s OK, there is a rake task for this:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;rake gems:install&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Completes succesfully. That&#8217;s all &#8211; now &lt;code&gt;script/console&lt;/code&gt; loads OK.&lt;/p&gt;


	&lt;h4&gt;Gentoo&lt;/h4&gt;


	&lt;p&gt;With Gentoo, you never need to choose configure script options. Instead, you need to configure the whole system. You only need to do it once, though no problem to adjust any settings later and re-compile affected packages. Basically, you just read the description provided and enable or disable options according to your needs. For example, if you are never going to use X server, you add it to the system-wide configuration with the minus: &lt;code&gt;-X&lt;/code&gt;. From now on no package will ever need X server or X-related libraries as its dependencies. This initial step is quite time-consuming, also it assumes that you are familiar with various software pieces and their relations. But the further management of properly configured system is just like a dream.&lt;/p&gt;


	&lt;p&gt;So here is what my task looks like on Gentoo:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;Compiling and installing Ruby of required version:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;emerge =ruby-&amp;lt;version&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;(or just 'emerge ruby', if you want the latest stable version)&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;Now Rubygems:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;emerge rubygems&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;The rest goes as easy as with pure &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt;:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;9&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;11&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;Rails first. It's available via Portage system, but I prefer to use Rubygems for this:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;gem install rails -v &amp;lt;version&amp;gt;&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;Checking if it works:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;script/console&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;Installing missing gems:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;rake gems:install&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Done.&lt;/p&gt;


	&lt;h4&gt;Ubuntu&lt;/h4&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;Installing Ruby and Rubygems is easy:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;apt-get install ruby1.8 rubygems&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;Now Rails:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;gem install rails -v &amp;lt;version&amp;gt;&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Easy. Testing the result:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;8&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;script/console&lt;tt&gt;
&lt;/tt&gt;  irb not found&lt;tt&gt;
&lt;/tt&gt;???&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;ruby --version&lt;tt&gt;
&lt;/tt&gt;  ruby 1.8.7&lt;tt&gt;
&lt;/tt&gt;irb&lt;tt&gt;
&lt;/tt&gt;  irb: command not found&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;WTH&lt;/span&gt;? Irb is a Ruby shell, it&#8217;s the part of Ruby!&lt;/p&gt;


	&lt;p&gt;In such occasions I use aptitude &#8211; it&#8217;s an interface to Debian package management system. Inside there is a convenient search option. This way, probing various patterns, you can eventually find what package you need. In this case it&#8217;s pretty obvious: the needed package name is irb. But! There is also a package named ruby-full. It&#8217;s a &#8220;virtual&#8221; package made for convenience. You can install it and have everything relating to Ruby. But if you list all the packages it is going to install, you&#8217;ll probably be shocked: it&#8217;s 111 packages, including, for example, hicolor-icon-theme (Gnome desktop icons collection), several libavahi packages (it&#8217;s an automatic network configuration tool), libgl1-mesa-dri (Direct Rendering Infrastructure support for Mesa OpenGL), libxinerama1 (multiple displays support for X server), a lot of X rendering-related libraries including even libxcomposite1 (desktop visual effects support library). I understand that they are needed if you are going to use Ruby for desktop applications development, but using this virtual package to get Ruby properly installed on a web server doesn&#8217;t sound like a good idea.&lt;/p&gt;


	&lt;p&gt;I mention this package for a good reason though: this is a shortest way to find out if there are any other parts of Ruby missing. And yes, reading through those 111 packages I find several other important commands that are parts of Ruby initially, but &lt;code&gt;apt-get install ruby&lt;/code&gt; doesn&#8217;t install them, so I install them now, in a single row:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;apt-get install rake irb rdoc ri&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Now I run &lt;code&gt;script/console&lt;/code&gt; and it complains about missing gems, as expected.&lt;/p&gt;


	&lt;p&gt;Trying to install them I get:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;rake gems:install&lt;tt&gt;
&lt;/tt&gt;  rake aborted!&lt;tt&gt;
&lt;/tt&gt;  no such file to load -- rspec&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Ohh, it&#8217;s yet another part of Ruby that has not been installed. Searching by &#8216;rspec&#8217; keyword I find it out:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;apt-get install librspec-ruby1.8&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Trying again:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;rake gems:install&lt;tt&gt;
&lt;/tt&gt;  rake aborted!&lt;tt&gt;
&lt;/tt&gt;  no such file to load -- mime/types&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;# OK, found:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;apt-get install libmime-types-ruby&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;and again:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;6&lt;tt&gt;
&lt;/tt&gt;7&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;rake gems:install&lt;tt&gt;
&lt;/tt&gt;  rake aborted!&lt;tt&gt;
&lt;/tt&gt;  no such file to load -- net/https&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;# found, too:&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;apt-get install libopenssl-ruby1.8&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;At last it starts installing gems:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;gem install nokogiri&lt;tt&gt;
&lt;/tt&gt;  ERROR: Failed to build gem native extension.&lt;tt&gt;
&lt;/tt&gt;  extconf.rb:5:in `require': no such file to load -- mkmf (LoadError)&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;With Google help I find that mkmf is a part of ruby-dev package. OK, OK, I suspected I would need it.&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;strong&gt;5&lt;/strong&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;apt-get install ruby-dev&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;gem install nokogiri&lt;tt&gt;
&lt;/tt&gt;  ERROR: Failed to build gem native extension.&lt;tt&gt;
&lt;/tt&gt;  checking for libxml/parser.h... no&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;If you think that the system has no libxml installed, you are not familiar enough with binary distros:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;apt-get install libxml2&lt;tt&gt;
&lt;/tt&gt;  libxml2 is already the newest version.&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;What it really wants is:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;apt-get install libxml2-dev&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;OK, next round:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;gem install nokogiri&lt;tt&gt;
&lt;/tt&gt;  ERROR: Failed to build gem native extension.&lt;tt&gt;
&lt;/tt&gt;  checking for libxslt/xslt.h... no&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;but I already know what it wants:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;1&lt;tt&gt;
&lt;/tt&gt;2&lt;tt&gt;
&lt;/tt&gt;3&lt;tt&gt;
&lt;/tt&gt;4&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;apt-get install libxslt-dev&lt;tt&gt;
&lt;/tt&gt;&lt;tt&gt;
&lt;/tt&gt;gem install nokogiri&lt;tt&gt;
&lt;/tt&gt;  success&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;


	&lt;p&gt;Ooophhh!&lt;/p&gt;


	&lt;p&gt;Do you see now how you may come to the conclusion that Linux is a pain? All you need to come to this is:&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;to believe that those distros are Linux&lt;/li&gt;
		&lt;li&gt;to need something that the distro of your choice doesn&#8217;t include, or to want this installed &lt;cite&gt;your&lt;/cite&gt; way.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;Yes, I could install that ruby-full package and I would have everything I need, but with such approach I would get all systems I am maintaining growing in an uncontrollable manner, let alone unneeded services that might get installed as dependencies, that need to be removed later, otherwise they will be consuming resources and keeping open ports, and each open port is a potential security hole and so on and so on.&lt;/p&gt;


	&lt;p&gt;There exists another point I am argued with from time to time: Red Hat (Ubuntu, whatever) is a well-known and stable brand, and we trust it.&lt;/p&gt;


	&lt;p&gt;Well, yes, I can understand this. They are commercial companies and they care about their brand. But think about this: they rely on something, too. They rely on their upstreams: the developers of open source software. First of all, they rely on Linux and &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt;. Linux and &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt; are the only two brands in Linux world that you can trust absolutely. Otherwise you wouldn&#8217;t use Linux, would you? So what&#8217;s the problem using its pure form rather than something modified?&lt;/p&gt;


	&lt;p&gt;If you think I found a particularly hard case, try to find out how to install rmagick gem on Debian/Ubuntu properly :) This is a &lt;cite&gt;real&lt;/cite&gt; pain.&lt;/p&gt;


	&lt;p&gt;If you think Debian/Ubuntu is bad, it&#8217;s not true. I prefer Debian-based distros over RedHat-based distros. On RedHat and its derivatives you just can&#8217;t find needed packages at all. Or can find packages, but their versions are too old to be usable. So you end up with getting packages from unofficial repositories or even worse &#8211; you have to compile from sources. The latter is a bad idea, because it&#8217;s very probable that some package (similar to abovementioned ruby-full) will want to install the software you have already installed from source as a dependency and you know what? &#8211; it will install it! Package management system doesn&#8217;t know about anything you install without its help. So from its point of view everything will be alright, but in fact the system will be messed up. Of course it&#8217;s not this stupid, there are proper ways: you will need to learn how to use &lt;span class=&quot;caps&quot;&gt;SRPM&lt;/span&gt; and how to create your own packages. But tell me one thing: does it sound easier than using pure &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt;/Linux or Gentoo at least?&lt;/p&gt;


	&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; &lt;acronym title=&quot;Linux From Scratch&quot;&gt;LFS&lt;/acronym&gt; is not a distribution, it&#8217;s a &lt;a href=&quot;http://www.linuxfromscratch.org&quot;&gt;book of instructions&lt;/a&gt; about compiling pure &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt;/Linux OS from scratch.&lt;/p&gt;


	&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt; Gentoo is more like distribution, but it doesn&#8217;t provide binary packages except those needed as a start point for compiling the whole system. It provides compilation scripts bound by full-featured management system named Portage.&lt;/p&gt;


	&lt;p&gt;&lt;sup&gt;3&lt;/sup&gt; Ubuntu is a very popular Debian-based binary distribution. Its goal is desktop systems primarily, but it&#8217;s being widely used as a server system too. As a Debian derivative, it is a bit more flexible compared to most &lt;acronym title=&quot;originally RedHat Package Manager&quot;&gt;RPM&lt;/acronym&gt;-based distros.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.reticularium.com/">
    <author>
      <name>Igor</name>
    </author>
    <id>tag:www.reticularium.com,2011-01-18:1105</id>
    <published>2011-01-18T09:44:00+01:00</published>
    <updated>2011-01-18T09:59:27+01:00</updated>
    <category term="ERR"/>
    <category term="RoR"/>
    <category term="passenger"/>
    <link href="http://www.reticularium.com/2011/1/18/1105" rel="alternate" type="text/html"/>
    <title>Passenger memory stats decolorifying</title>
<content type="html">
            &lt;p&gt;Just to save for future use..&lt;/p&gt;


&lt;pre&gt;
passenger-memory-stats | sed 's|[^[:print:]]||g' | sed 's|\[44m\[1m\[33m||g' | sed 's|\[37m||g' | sed 's|\[0m||g'
&lt;/pre&gt;

	&lt;p&gt;I wonder why at all they use colors for the output. Since it&#8217;s the only way for Passenger based setups to get some info about memory usage, its output should have at least plain text option to be used in other scripts.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.reticularium.com/">
    <author>
      <name>Igor</name>
    </author>
    <id>tag:www.reticularium.com,2009-10-11:22</id>
    <published>2009-10-11T16:58:00+02:00</published>
    <updated>2009-10-16T09:07:19+02:00</updated>
    <category term="ERR"/>
    <category term="RoR"/>
    <category term="error"/>
    <category term="ror"/>
    <link href="http://www.reticularium.com/2009/10/11/22" rel="alternate" type="text/html"/>
    <title>Git plugin support doesn't work in Rails 2.3.4</title>
<content type="html">
            &lt;p&gt;It&#8217;s a 2.3 bug still not fixed in 2.3.4 gems according to &lt;a href=&quot;http://github.com/blog/25-git-support-for-rails-plugins&quot;&gt;this thread&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;On my new server with Rails 2.3.4 installed it looks like this:&lt;/p&gt;


	&lt;p&gt;I run script/plugin install git://github.com/whatever/plugin.git and then just nothing happens.&lt;/p&gt;


	&lt;p&gt;Recipe from above mentioned thread works for me, so I have to run instead:&lt;/p&gt;


&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td class=&quot;code&quot;&gt;&lt;pre&gt;script/plugin install http://github.com/whatever/plugin.git/&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;


	&lt;p&gt;Note slash at the end!&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.reticularium.com/">
    <author>
      <name>Igor</name>
    </author>
    <id>tag:www.reticularium.com,2009-08-19:5</id>
    <published>2009-08-19T11:01:00+02:00</published>
    <updated>2009-10-16T09:12:08+02:00</updated>
    <category term="ERR"/>
    <category term="RoR"/>
    <category term="recipe"/>
    <category term="rjs"/>
    <category term="ror"/>
    <link href="http://www.reticularium.com/2009/8/19/5" rel="alternate" type="text/html"/>
    <title>RJS and PrototypeHelper methods</title>
<content type="html">
            &lt;p&gt;Quite a common mistake.&lt;/p&gt;


	&lt;p&gt;Never use :update option of PrototypeHelper methods (like link_to_remote) together with &lt;span class=&quot;caps&quot;&gt;RJS&lt;/span&gt; templates. Simply remove :update and &lt;span class=&quot;caps&quot;&gt;RJS&lt;/span&gt; will care about it. Another option is to avoid using &lt;span class=&quot;caps&quot;&gt;RJS&lt;/span&gt; if possible.&lt;/p&gt;
          </content>  </entry>
  <entry xml:base="http://www.reticularium.com/">
    <author>
      <name>Igor</name>
    </author>
    <id>tag:www.reticularium.com,2009-08-10:4</id>
    <published>2009-08-10T21:36:00+02:00</published>
    <updated>2010-02-16T17:57:54+01:00</updated>
    <category term="ERR"/>
    <category term="RoR"/>
    <category term="recipe"/>
    <category term="ror"/>
    <link href="http://www.reticularium.com/2009/8/10/4" rel="alternate" type="text/html"/>
    <title>Multiple conditions for find (ActiveRecord::Base)</title>
<content type="html">
            &lt;p&gt;Had to spend some time to figure out:&lt;/p&gt;


&lt;div&gt;
&lt;table class=&quot;CodeRay&quot;&gt;&lt;tr&gt;
  &lt;td title=&quot;click to toggle&quot; class=&quot;line_numbers&quot;&gt;&lt;pre&gt;&lt;tt&gt;
&lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  &lt;td title=&quot;double click to expand&quot; class=&quot;code&quot; alt=&quot;double click to expand&quot;&gt;&lt;pre&gt;&lt;span class=&quot;co&quot;&gt;Person&lt;/span&gt;.find &lt;span class=&quot;sy&quot;&gt;:all&lt;/span&gt;, &lt;span class=&quot;sy&quot;&gt;:conditions&lt;/span&gt; =&amp;gt; [ &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;user_name = ? AND surname = ? AND address = ?&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, user_name, surname, address]&lt;/pre&gt;&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
          </content>  </entry>
</feed>

