<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>Ölbaum’s Delirium</title>
      <link>http://ithink.ch/blog/</link>
      <description>on Life, the Universe and Everything…</description>
      <language>en</language>
      <copyright>Copyright 2013</copyright>
      <lastBuildDate>Sat, 16 Mar 2013 23:25:51 +0100</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/?v=4.38</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

      
      <item>
         
         
         
            <title>Why the End of Google Reader Is Good News</title>
            <link>http://ithink.ch/blog/2013/03/16/why_the_end_of_google_reader_is_good_news.html</link>
         
         <description><![CDATA[<p>A vast majority of fellow geeks is up in arms about the announcement of the end of Google Reader, but I cheered. It’s awesome news. Let me explain:</p>

<p>Google Reader kinda sucked<sup class="footnoteRef"><a id="ref_1_248_1" href="#def_1_248_1">1</a></sup> in many ways. It didn’t support authenticated feeds. If you had personal feeds for which you were the only subscriber, like issues assigned to you in your bug tracker or a <a href="http://pinboard.in/">Pinboard</a> tag, it would only be updated once every 24 hours. And if you didn’t use the system for a week or so (ever heard of holidays?), those personal feeds would stop being updated altogether. That’s the kind of situation where the term UX actually makes sense, in that it’s a shitty experience for the user.</p>

<p>Now you might be inclined to to tell me that if I don’t like it, I should just not use it. I’ll love to, but currently, some 95% of feed readers rely on Google Reader for syncing, and the remaining 5% all suck. What’s ironic is that I don’t even need syncing: I exclusively read feeds in <a href="http://reederapp.com/ipad/">Reeder</a> for iPad. I couldn’t care less (notice the proper use of this difficult expression) if my feed reader couldn’t sync. But those applications don’t just rely on Google Reader for syncing, they require it, plain and simple. So no matter how well done they otherwise are, you remain stuck by Reader’s limitations.</p>

<p>Now that Google Reader is dead, we can hope that existing feed readers won’t be abandoned and will either rely on other services (we’ll probably see a <a href="http://feedafever.com">Fever</a>-enabled Reeder for iPad before July 1st) or, more smartly, on no service at all, except if you need syncing. That a lot more than what we could hope for last week.</p>

<div class="footnotes">

<p><a id="def_1_248_1">1.</a> yes, I’m already using the past tense; that’s because I’m so impatient to see it go.&nbsp;<a class="footnoteBack" href="#ref_1_248_1">&#8617;</a></p>

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=google%20reader%20rss%20atom%20reeder&amp;limit=20">google reader rss atom reeder</a></description>
         <guid>http://ithink.ch/blog/2013/03/16/why_the_end_of_google_reader_is_good_news.html</guid>
         <category>Olives &amp; Apples</category>
         <pubDate>Sat, 16 Mar 2013 23:25:51 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Catorce</title>
            <link>http://ithink.ch/blog/2012/09/04/catorce.html</link>
         
         <description><![CDATA[<p><img src="http://ithink.ch/blog/files/u2/U2.jpg" alt="U2.jpg" title="" /></p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=offspring&amp;limit=20">offspring</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=u2&amp;limit=20">u2</a></description>
         <guid>http://ithink.ch/blog/2012/09/04/catorce.html</guid>
         <category>Main</category>
         <pubDate>Tue, 04 Sep 2012 22:48:34 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Time Machine Waiting for Index to Be Ready</title>
            <link>http://ithink.ch/blog/2012/08/19/time_machine_waiting_for_index_to_be_ready.html</link>
         
         <description><![CDATA[<p>My Time Machine backup (on OS X 10.7) was stuck on <em>Waiting for index to be ready (100)</em> for a long time (it kept logging this once every minute for 20 minutes).</p>

<p>I ended up killing the <code>mds</code> process. I was treated with an <em>Indexer unavailable (200)</em>, then another <em>Waiting for index to be ready</em>, then the backup completed successfully:</p>

<pre><code>19.08.2012 14:25:34.270 com.apple.backupd: Waiting for index to be ready (100)
19.08.2012 14:26:34.352 com.apple.backupd: Waiting for index to be ready (100)
19.08.2012 14:27:34.429 com.apple.backupd: Waiting for index to be ready (100)
19.08.2012 14:28:13.502 com.apple.backupd: Indexer unavailable (200)
19.08.2012 14:28:35.520 com.apple.backupd: Waiting for index to be ready (100)
19.08.2012 14:30:14.957 com.apple.backupd: Copied 2944 files (5.2 MB) from volume filemate.
19.08.2012 14:30:15.574 com.apple.backupd: Copied 2955 files (5.2 MB) from volume 500GB.
19.08.2012 14:30:32.853 com.apple.backupd: Backup completed successfully.
</code></pre>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=10.7&amp;limit=20">10.7</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Index&amp;limit=20">Index</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Lion&amp;limit=20">Lion</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Mac%20OS%20X&amp;limit=20">Mac OS X</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Spotlight&amp;limit=20">Spotlight</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Time%20Machine&amp;limit=20">Time Machine</a></description>
         <guid>http://ithink.ch/blog/2012/08/19/time_machine_waiting_for_index_to_be_ready.html</guid>
         <category>Knowledge base</category>
         <pubDate>Sun, 19 Aug 2012 14:40:10 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Hands-On with Review of Google Sparrow for Mac and iOS</title>
            <link>http://ithink.ch/blog/2012/07/21/hands-on_with_review_of_google_sparrow_for_mac_and_ios.html</link>
         
         <description><![CDATA[<p>I’m aware that this product has not even been rumoured yet and nobody outside Google knows what’s in store, but Smarrow, the result of the acquisition by Google of the Sparrow e-mail client, is already my <strong>all-time favourite</strong> Gmail/Google Reader/Google+/Google Groups/Google Maps/Google Mashed Potatoes Home Delivery client for Mac and iOS, though it lacks ludicrous-res graphics for the triple-Retina iPhone 5 that will ship on August 7th, which will be a show-stopper for some. As expected, the Android version is less polished and lacks a few features, but it’s more open by a good 15°, so it’s winning.</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=android&amp;limit=20">android</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=gmail&amp;limit=20">gmail</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=google&amp;limit=20">google</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=ios&amp;limit=20">ios</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=mac&amp;limit=20">mac</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=rumour&amp;limit=20">rumour</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=sparrow&amp;limit=20">sparrow</a></description>
         <guid>http://ithink.ch/blog/2012/07/21/hands-on_with_review_of_google_sparrow_for_mac_and_ios.html</guid>
         <category>Crazy rumours</category>
         <pubDate>Sat, 21 Jul 2012 18:57:38 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Incredibox</title>
            <link>http://ithink.ch/blog/2012/04/15/incredibox.html</link>
         
         <description><![CDATA[<p><img src="http://ithink.ch/blog/files/incredibox/box.jpg" alt="Incredibox" border="0" width="460" height="1600" /></p>

<p>(At the time of this writing, Incredibox had been 9gagged.)</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Beat&amp;limit=20">Beat</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Incredibox&amp;limit=20">Incredibox</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Music&amp;limit=20">Music</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Sample&amp;limit=20">Sample</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=%C3%80%20la%20volette&amp;limit=20">À la volette</a></description>
         <guid>http://ithink.ch/blog/2012/04/15/incredibox.html</guid>
         <category></category>
         <pubDate>Sun, 15 Apr 2012 13:59:03 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Le “livre brun” Recettes Culinaires enfin réédité</title>
            <link>http://ithink.ch/blog/2012/01/13/le_livre_brun_recettes_culinaires_enfin_reedite.html</link>
         
         <description><![CDATA[<p><img src="http://ithink.ch/blog/files/recettes/recettes-ancien.jpg" alt="Recettes culinaires et hygiène alimentaire – Le livre brun – Ancienne Édition" title="" /></p>

<p><a href="http://www.recettes-culinaires.ch/">Le “livre brun” Recettes Culinaires</a>, que certains d’entre nous utilisaient à l’école ménagère, est enfin réédité et disponible en ligne.</p>

<p>Voir les articles sur le blog de Gasser Media :</p>

<ul>
<li><a href="http://www.gasser-media.ch/editions/recettes-culinaires-et-hygiene-alimentaire-un-ouvrage-incontournable-reedite/">Recettes culinaires et hygiène alimentaire – un ouvrage incontournable réédité !</a></li>
<li><a href="http://www.gasser-media.ch/editions/le-livre-de-cuisine-recettes-culinaires-hygiene-alimentaire-fait-encore-parler-de-lui/">Le livre de cuisine Recettes culinaires-hygiène alimentaire fait encore parler de lui…</a></li>
</ul>

<p>et <a href="http://www.tsr.ch/video/info/journal-12h45/3710342-le-minimag-vd-un-ouvrage-intitule-bex-le-sel-d-une-cite-nous-fait-redecouvrir-les-moments-les-plus-fastes-de-la-commune-vaudoise.html">son passage au minimag de la TSR</a>.</p>

<p><img src="http://ithink.ch/blog/files/recettes/recettes-nouveau.jpg" alt="Recettes culinaires et hygiène alimentaire – Le livre brun – Nouvelle Édition" title="" /></p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Alimentaire&amp;limit=20">Alimentaire</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Cooking&amp;limit=20">Cooking</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Cuisine&amp;limit=20">Cuisine</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Culinaires&amp;limit=20">Culinaires</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Food&amp;limit=20">Food</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Hygi%C3%A8ne&amp;limit=20">Hygiène</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Recettes&amp;limit=20">Recettes</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Recipes&amp;limit=20">Recipes</a></description>
         <guid>http://ithink.ch/blog/2012/01/13/le_livre_brun_recettes_culinaires_enfin_reedite.html</guid>
         <category>Main</category>
         <pubDate>Fri, 13 Jan 2012 18:24:03 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Noah</title>
            <link>http://ithink.ch/blog/2011/12/19/noah.html</link>
         
         <description><![CDATA[<p><img src="http://ithink.ch/blog/files/dumbledore/1136719_700b.jpg" alt="1136719_700b.jpg" border="0" width="624" height="1014" /></p>

<div class="footnotes">

</div>
]]></description>
         <guid>http://ithink.ch/blog/2011/12/19/noah.html</guid>
         <category>Main</category>
         <pubDate>Mon, 19 Dec 2011 21:51:50 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Abysmal Michael Gambon</title>
            <link>http://ithink.ch/blog/2011/12/06/abysmal_michael_gambon.html</link>
         
         <description><![CDATA[<p><img src="http://ithink.ch/blog/files/dumbledore/dumbledore.jpg" alt="dumbledore.jpg" border="0" width="633" height="997" title="I run this shit. – No, you don’t. DUMBLEDORE ran this shit. And Dumbledore was played by RICHARD HARRIS, LIKE A BOSS. You’re just an usurping ass clown not even worthy of preparing afternoon tea for his stand-in."/></p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Dumbledore&amp;limit=20">Dumbledore</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Harry%20Potter&amp;limit=20">Harry Potter</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Michael%20Gambon&amp;limit=20">Michael Gambon</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Richard%20Harris&amp;limit=20">Richard Harris</a></description>
         <guid>http://ithink.ch/blog/2011/12/06/abysmal_michael_gambon.html</guid>
         <category>Main</category>
         <pubDate>Tue, 06 Dec 2011 23:16:45 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Good Guy Ajay</title>
            <link>http://ithink.ch/blog/2011/11/06/good_guy_ajay.html</link>
         
         <description><![CDATA[<p><img src="http://ithink.ch/blog/files/jedi/good-gyu-ajay.jpg" alt="good-gyu-ajay.jpg" border="0" width="607" height="534" title="Is sick of struggling with printer plugs. Invents USB."/></p>

<p>And here’s the antithesis to <a href="http://ithink.ch/blog/2011/11/06/scumbag_ajay.html">the previous one</a>.</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Ajay%20Bhatt&amp;limit=20">Ajay Bhatt</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Good%20Guy%20Greg&amp;limit=20">Good Guy Greg</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Plug&amp;limit=20">Plug</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Printer&amp;limit=20">Printer</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=USB&amp;limit=20">USB</a></description>
         <guid>http://ithink.ch/blog/2011/11/06/good_guy_ajay.html</guid>
         <category>Main</category>
         <pubDate>Sun, 06 Nov 2011 18:35:05 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Scumbag Ajay</title>
            <link>http://ithink.ch/blog/2011/11/06/scumbag_ajay.html</link>
         
         <description><![CDATA[<p><img src="http://ithink.ch/blog/files/jedi/scumbag-ajay.jpg" alt="scumbag-ajay.jpg" border="0" width="607" height="534" title="Is sick of struggling with printer plugs. Invents USB."/></p>

<p>From CNN Tech, <a href="http://articles.cnn.com/2010-02-04/tech/ajay.bhatt.usb.inventor_1_usb-plugs-rock?_s=PM:TECH">USB inventor is tech&#8217;s unlikely ‘rock star’</a>:</p>

<blockquote>
  <p>In the early 1990s, [Ajay] Bhatt, like many people, was trying to hook up a printer to his computer. To do so, he first had to fiddle with a plug that had a dozen or more tongs on it. The plugs of the &#8217;90s looked somewhat like acupuncture devices. They were difficult to use. Tiny screws held them in place.</p>

<p>[…]</p>

<p>“There&#8217;s got to be a better way to do this,” he recalled in a recent interview.</p>
</blockquote>

<p><strong>Note regarding the post title:</strong> “Scumbag Steve” is the <a href="http://knowyourmeme.com/memes/scumbag-steve">Internet meme</a> that inspired this montage. It’s not me being offensive (for once).</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Ajay%20Bhatt&amp;limit=20">Ajay Bhatt</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Plug&amp;limit=20">Plug</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Printer&amp;limit=20">Printer</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Scumbag&amp;limit=20">Scumbag</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Steve&amp;limit=20">Steve</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=USB&amp;limit=20">USB</a></description>
         <guid>http://ithink.ch/blog/2011/11/06/scumbag_ajay.html</guid>
         <category>Main</category>
         <pubDate>Sun, 06 Nov 2011 18:07:45 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Jedi Bathrobe</title>
            <link>http://ithink.ch/blog/2011/10/25/jedi_bathrobe.html</link>
         
         <description><![CDATA[<p><img src="http://ithink.ch/blog/files/jedi/Jedi.jpg" alt="Jedi.jpg" border="0" width="700" height="1080" title="Admit It – You never needed one of these to feel like a Jedi or Sith lord when wearing a bathrobe...."/></p>

<p>Just something I made to post on <a href="http://9gag.com/">9gag</a>…</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Bathrobe&amp;limit=20">Bathrobe</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Jedi&amp;limit=20">Jedi</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Sith&amp;limit=20">Sith</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Star%20Wars&amp;limit=20">Star Wars</a></description>
         <guid>http://ithink.ch/blog/2011/10/25/jedi_bathrobe.html</guid>
         <category>Main</category>
         <pubDate>Tue, 25 Oct 2011 00:10:07 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Installer Redmine sur Mac OS X 10.6: La façon correcte</title>
            <link>http://ithink.ch/blog/2011/10/02/installer_redmine_sur_mac_os_x_106_la_facon_correcte.html</link>
         
         <description><![CDATA[<ul>
<li>This post is also available <a href="http://ithink.ch/blog/2011/09/25/installing_redmine_on_mac_os_x_106_the_correct_way.html">in English</a></li>
<li>Ceci est la traduction française de <a href="http://ithink.ch/blog/2011/09/25/installing_redmine_on_mac_os_x_106_the_correct_way.html">mon post en anglais</a> du week-end dernier.</li>
</ul>

<p>Oui, c&#8217;est un titre plutôt prétentieux étant donné que c&#8217;est la première fois que je réussis à installer une application Rails, et non, cela ne me dérange pas. C&#8217;était agréable comme un coup de pied au cul alors je dois documenter la façon dont j&#8217;y suis parvenu et cela pourrait rendre service à d&#8217;autres, alors si ça vous dérange, lisez-le comme &#8216;la façon correcte pour moi&#8217;.</p>

<p><a href="http://www.redmine.org/">Redmine</a> (1.2.1 du 2011-07-11 au moment d&#8217;écrire ces lignes) est <a href="http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Requirements">sacrément regardant en ce qui concerne ses prérequis</a>: les gems (et aussi Ruby et RubyGems) ne doivent pas être trop anciens, certains ne peuvent pas être trop récents, et l&#8217;un d&#8217;eux (i18n) ne peut même pas être d&#8217;une version différente que celle spécifiée (0.4.2).</p>

<p>La <a href="http://www.redmine.org/projects/redmine/wiki/RedmineInstall">page d&#8217;installation de Redmine</a> indique qu&#8217;il nécessite:</p>

<ul>
<li>Ruby 1.8.6 ou 1.8.7, pas 1.9;</li>
<li>RubyGems 1.3.7 ou plus récent, mais pas la 1.5.0 ni la 1.7.0 ou supérieure, parce que Rails 2.3.11 ne fonctionne pas avec celles-ci;</li>
<li>Rails 2.3.11 (puis plus loin mentionne que la 2.3.14 fonctionne aussi);</li>
<li>Rack 1.1.1;</li>
<li>Rake 0.8.7 (pas la 0.9.x parce qu&#8217;elle n&#8217;est pas supportée par Rails);</li>
<li>i18n 0.4.2 (la version 0.6.0 actuelle causera une erreur parce que la 0.4.2 est introuvable).</li>
</ul>

<p>De plus, Redmine est distribué avec Rails 2.3.11 dans le dossier &#8216;vendor&#8217;, et utilisera celui-là à moins que vous ne l&#8217;en supprimiez et changiez la version désirée dans <code>config/environment.rb</code>. Ceci est élégamment documenté sur la page d&#8217;installation par une phrase très explicative: “read <code>config/environment.rb</code> first”. Simplement changer la version de Rails dans ce fichier n&#8217;aidera pas: si Redmine trouve Rails dans son dossier &#8216;vendor&#8217;, il utilisera celui-là.</p>

<p>La réalité des prérequis de Redmine est légèrement différente. Rake 0.9.x est supporté par Rails 2.3.14 (il installe la 0.9.2 avec ses dépendances), mais RubyGems 1.7.0 ou plus récent ne l&#8217;est quand-même pas. Alors pour réduire la quantité de software obsolète et buggué que l&#8217;installe et les soucis qui s&#8217;ensuivent, je vais utiliser Rails 2.3.14.</p>

<h3>Utiliser RVM</h3>

<p><a href="http://beginrescueend.com/">Ruby Version Manager</a>, ou RVM, permet d&#8217;utiliser une version de Ruby et une gamme de gems différents pour des projets différents, sans installer lesdits gems au niveau du système. I est similaire au <a href="http://www.virtualenv.org/">virtualenv</a> de Python. À mon avis, il est absolument vital de l&#8217;employer dès le départ. Vous ne savez pas quels autres programmes vous pourriez vouloir installer, programmes qui pourraient avoir des prérequis aussi délicats que Redmine mais dans des version différentes. </p>

<p>RVM se trouve à l&#8217;adresse <a href="http://beginrescueend.com/">http://beginrescueend.com/</a> et <a href="http://beginrescueend.com/rvm/install/">s&#8217;installe comme ceci</a> (apparemment il nécessite <a href="http://git-scm.org/">git</a>, ce qui est un peu gonflant si vous ne vous en servez pas. Mais vous devriez l&#8217;essayer, couplé à la version d&#8217;évaluation de <a href="http://git-tower.com/">Tower</a>, c&#8217;est fantastique une fois que vous commencez à piger):</p>

<pre><code>$ bash &lt; &lt;(curl -s https://rvm.beginrescueend.com/install/rvm)
</code></pre>

<p>Ajoutez ensuite ceci à votre fichier<code>.bash_profile</code> ou <code>.zshrc</code> (vous voulez clairement passer à <a href="http://www.zsh.org/">zsh</a> et utiliser <a href="https://github.com/robbyrussell/oh-my-zsh">oh-my-zsh</a>, parce qu&#8217;ils sont fantastiques également), comme indiqué par le script d&#8217;installation (personnalisé pour votre  <code>$HOME</code>):</p>

<pre><code># This loads RVM into a shell session.
[[ -s "/Users/olivier/.rvm/scripts/rvm" ]] &amp;&amp; source "/Users/olivier/.rvm/scripts/rvm"
</code></pre>

<p>Ensuite nous devons installer la dernière version de Ruby pré-1.9 pour utiliser avec RVM. RVM le compile depuis les sources, mais cela ne prends pas trop longtemps (et si vous trouvez que si, faites un saut sur <a href="http://9gag.com/">9gag.com</a>). On peut lister les version disponibles de Ruby et ensuite installer celle que l&#8217;on veut, c&#8217;est à dire la 1.8.7 (qui donnera <code>ruby-1.8.7-p352</code>), comme suit:</p>

<pre><code>$ rvm list known

# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.6-head
[ruby-]1.8.7[-p352]
[ruby-]1.8.7-head
[ruby-]1.9.1-p378
[ruby-]1.9.1[-p431]
[ruby-]1.9.1-head
[ruby-]1.9.2-p180
[ruby-]1.9.2[-p290]
[ruby-]1.9.2-head
[ruby-]1.9.3[-preview1]
[ruby-]1.9.3-head
ruby-head
...

$ rvm install 1.8.7
...
$ rvm use 1.8.7
</code></pre>

<p>Une fois fait, nous allon créer un gemset pour Redmine, où RubyGems installera les gems dont nous avons besoin, dans les versions dont nous avons besoin, sans interférer avec l&#8217;installation système.</p>

<pre><code>$ rvm gemset create redmine
'redmine' gemset created (/Users/olivier/.rvm/gems/ruby-1.8.7-p352@redmine).
$ rvm gemset use redmine
</code></pre>

<p><strong>Notes:</strong></p>

<ol>
<li><p>La version de Ruby et le gemset employés sont liés à la session shell, ce qui fait que vous devez les changer à nouveau à chaque nouvelle session. Cela peut être effectué en une étape:</p>

<pre><code>$ rvm use 1.8.7@redmine
Using /Users/olivier/.rvm/gems/ruby-1.8.7-p352 with gemset redmine
</code></pre></li>
<li><p>L&#8217;environnement en cours d&#8217;utilisation peut être vérifié avec <code>rvm-prompt</code>:</p>

<pre><code>$ rvm-prompt        
ruby-1.8.7-p352@redmine
</code></pre></li>
<li><p>Vous pouvez repasser au Ruby système avec:</p>

<pre><code>$ rvm use system
Now using system ruby.
</code></pre></li>
<li><p>Il n&#8217;y a pas besoin de <code>sudo</code> pour installer des gems dans un gemset RVM, parce que tous les fichiers sont contenus dans votre dossier Home.</p></li>
<li><p>Quand un gemset est en cours d&#8217;utilisation, les commandes Rake doivent être préfixées par rvm:</p>

<pre><code>$ rvm rake bla bla
</code></pre></li>
</ol>

<h3>Installer les gems</h3>

<p>Tout d&#8217;abord, <a href="http://buddingrubyist.com/2009/02/14/how-to-speed-up-gem-installs-10x/">accélérons l&#8217;installation des gems d&#8217;un facteur 10</a>, comme suggéré par <a href="http://buddingrubyist.com/">The Budding Rubbyist</a>. Ajoutez ceci à votre fichier <code>~/.gemrc</code>, en le créant si nécessaire:</p>

<pre><code>gem: --no-ri --no-rdoc
</code></pre>

<p>Cela ommettra la documentation (que nous ne lirons jamais, étant donné que nous ne sommes intéressés qu&#8217;à installer des programmes Ruby, pas à en développer) à l&#8217;installation des gems, une étape inexplicablement très lente, puisqu&#8217;elle dure généralement plus longtemps que l&#8217;étape “Building native extensions. This could take a while…” de certains gems.</p>

<p>Ensuite, assurons-nous que nous utilisons bien le Ruby et le gemset créés précédemment:</p>

<pre><code>$ rvm use 1.8.7@redmine
</code></pre>

<p>Installons ensuite Rails 2.3.14 et i18n 0.4.2 (Rails installe i18n 0.6.0 mais souvenez-vous, Redmine ne la verrait pas même si on la bourrait dans son crâne épais avec une [we]brique):</p>

<pre><code>gem install rails -v=2.3.14
gem install i18n -v=0.4.2
</code></pre>

<p><strong>Note:</strong> pour déterminer que c&#8217;était Rails 2.3.14 que je voulais, j&#8217;ai listé toutes les versions disponibles et choisi la 2.3.x la plus récente:</p>

<pre><code>$ gem query  --all --remote -n '^rails$'

*** REMOTE GEMS ***

rails (3.1.0, 3.0.10, 3.0.9, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.3.14, 2.3.12, 2.3.11, 2.3.10, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.4, 2.0.2, 2.0.1, 2.0.0, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.0, 0.14.4, 0.14.3, 0.14.2, 0.14.1, 0.13.1, 0.13.0, 0.12.1, 0.12.0, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.5, 0.9.4.1, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.5, 0.8.0)
</code></pre>

<p>La commande <code>list</code> est plus simple mais affichera tout ce qui commence par <code>rails</code>, ce qui est un peu gênant:</p>

<pre><code>$ gem list --all --remote rails

*** REMOTE GEMS ***

rails (3.1.0, 3.0.10, 3.0.9, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.3.14, 2.3.12, 2.3.11, 2.3.10, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.4, 2.0.2, 2.0.1, 2.0.0, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.0, 0.14.4, 0.14.3, 0.14.2, 0.14.1, 0.13.1, 0.13.0, 0.12.1, 0.12.0, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.5, 0.9.4.1, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.5, 0.8.0)
rails-3-settings (0.1.1)
rails-action-args (0.1.1, 0.1.0)
rails-admin (0.0.0)
rails-and-solid (0.9.1, 0.9.0)
...
</code></pre>

<p>Je voulais utiliser SQLite (je n&#8217;ai pas pu compiler le gem mysql contre le MySQL de Zend Server, et je m&#8217;en fiche — oh, c&#8217;est notre shortstop), alors j&#8217;ai installé le gem sqlite3:</p>

<pre><code>gem install sqlite3
</code></pre>

<p>Nous devons aussi downgrader RubyGems depuis la dernière version (1.8.10 au moment d&#8217;écrire ces lignes) vers une version qui est au moins la 1.3.7 mais pas la 1.5.0, ni la 1.7.0 ou plus récente. La version que nous voulons peut être déterminée de la même façon que pour Rails, en demandant le gem rubygems-update:</p>

<pre><code>$ gem list --all --remote  rubygems-update

*** REMOTE GEMS ***

rubygems-update (1.8.10, 1.8.9, 1.8.8, 1.8.7, 1.8.6, 1.8.5, 1.8.4, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.2, 1.7.1, 1.7.0, 1.6.2, 1.6.1, 1.6.0, 1.5.3, 1.5.2, 1.5.0, 1.4.2, 1.4.1, 1.4.0, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.0, 1.1.1, 1.1.0, 1.0.1, 1.0.0, 0.9.5, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.11, 0.8.10, 0.8.8, 0.8.6, 0.8.5, 0.8.4, 0.8.3)
</code></pre>

<p>Nous voulons donc la 1.6.2:</p>

<pre><code>$ gem update --system 1.6.2
...
$ gem -v
1.6.2
</code></pre>

<p>Noter que d&#8217;anciennes versions de la commande <code>gem</code>, comme la 1.3.7 recommendée par Redmine, ne supportent pas de spécifier la version dans la commande <code>gem update --system</code>. Dans ce cas, vous devez d&#8217;abord obtenir la dernière version et ensuite la downgrader:</p>

<pre><code>$ gem update --system
$ gem update --system 1.6.2
</code></pre>

<p>Passons maintenant à l&#8217;installation de Redmine.</p>

<h3>Installer Redmine</h3>

<p><a href="http://www.redmine.org/projects/redmine/wiki/Download">Téléchargez</a> la dernière version stable (1.2.1 du 2011-07-11 au moment d&#8217;écrire ces lignes) et décompressez-la.</p>

<p>Nous devons désactiver le Rails 2.3.11 livré et dire à Redmine d&#8217;utiliser notre version 2.3.14. Dans <code>config/environment.rb</code>, changer ces lignes:</p>

<pre><code># Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
</code></pre>

<p>en:</p>

<pre><code># Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
</code></pre>

<p>Ensuite, déplacez Rails hors du dossier &#8216;vendor&#8217;, sinon Redmine utilisera l&#8217;ancienne version, quoique la ligne ci-dessus dise. Je le fais comme ceci:</p>

<pre><code>mv vendor/rails vendor.rails.disabled
</code></pre>

<p>Au fait, c&#8217;est le passage “read config/environment.rb first” dans la liste des prérequis et le “when vendor/rails is not present” dans le commentaire ci-dessus qui nous indique que nous devons enlever Rails du dossier &#8216;vendor&#8217;. Comme je l&#8217;ai dit, une phrase très explicative.</p>

<p>Procédons ensuite à l&#8217;installation. Avec SQLite, <code>database.yml</code> a l&#8217;allure suivante:</p>

<pre><code>production:
  adapter: sqlite3
  database: db/redmine.db
 
development:
  adapter: sqlite3
  database: db/redmine.db

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/redmine_test.db
</code></pre>

<p><strong>Note:</strong> Chez moi, les commandes suivantes étaient infestées d&#8217;alertes d&#8217;obsolescence comme celle-ci:</p>

<pre><code>rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
Please install RDoc 2.4.2+ to generate documentation.
WARNING: 'task :t, arg, :needs =&gt; [deps]' is deprecated.  Please use 'task :t, [args] =&gt; [deps]' instead.
    at redmine-1.2.1/lib/tasks/email.rake:170
</code></pre>

<p>À ma connaissance elles ne dérangent pas, à part en rendant difficile de savoir si la tâche s&#8217;est achevée avec succès ou pas.</p>

<p>Créez un &#8216;session store secret&#8217; (n&#8217;oubliez pas de taper <code>rvm rake</code> au lieu de <code>rake</code>):</p>

<pre><code>rvm rake generate_session_store
</code></pre>

<p>Créez la structure de la base de données:</p>

<pre><code>RAILS_ENV=production rvm rake db:migrate
</code></pre>

<p>Insérez la configuration par défaut dans la base de données:</p>

<pre><code>RAILS_ENV=production rvm rake redmine:load_default_data
</code></pre>

<p>Testez ensuite votre installation. Cela prend un petit moment pour démarrer. Les deux premières lignes apparaissent rapidement et vous permettent de vérifier que Redmine utilise la bonne version de Rails:</p>

<pre><code>=&gt; Booting WEBrick
=&gt; Rails 2.3.14 application starting on http://0.0.0.0:3000
</code></pre>

<p>Le serveur est prêt quand vous voyez ceci:</p>

<pre><code>=&gt; Call with -d to detach
=&gt; Ctrl-C to shutdown server
[2011-09-25 14:28:09] INFO  WEBrick 1.3.1
[2011-09-25 14:28:09] INFO  ruby 1.8.7 (2011-06-30) [i686-darwin10.8.0]
[2011-09-25 14:28:09] INFO  WEBrick::HTTPServer#start: pid=39670 port=3000
</code></pre>

<h3>Faire tourner Redmine sous Unicorn</h3>

<p>Avertissement: Je n&#8217;ai aucune idée de si utiliser Unicorn pour faire tourner Redmine est une bonne idée. Je sais juste que WEBrick n&#8217;est pas destiné à la production et que Passenger est un module Apache, et je préfère l&#8217;éviter si possible. Après-tout, nous sommes arrivés jusqu&#8217;ici sans nécessiter de droits administrateur.</p>

<p>J&#8217;ai trouvé les instructions sur <a href="http://blog.ronvalente.net/install-redmine-on-ubuntu-server">Install Redmine on Ubuntu Server</a> dans la liste des HowTo de Redmine, sauf la partie concernant le wrapper RVM, qui vient de <a href="http://brandontilley.com/2011/01/29/serving-rails-apps-with-rvm-nginx-unicorn-and-upstart.html">Brandon Tilley</a>.</p>

<p>Installez Unicorn, toujours sous RVM:</p>

<pre><code>$ gem install unicorn
</code></pre>

<p>Créez un wrapper pour <code>unicorn_rails</code>. Le wrapper fera tourner <code>unicorn_rails</code> avec la bonne version de Ruby et le bon gemset:</p>

<pre><code>$ rvm wrapper ruby-1.8.7-p352@redmine redmine unicorn_rails
</code></pre>

<p>Cela crée une commande <code>redmine_unicorn_rails</code> qui utilise l&#8217;environnement <code>ruby-1.8.7-p352@redmine</code>.</p>

<p>Créez le fichier de configuration d&#8217;Unicorn, par example <code>unicorn.conf</code> dans le dossier <code>config</code> de Redmine:</p>

<pre><code># /var/www/redmine/config/unicorn.conf

# Number of CPU Cores
worker_processes 2

# Same Redmine User
user "redmine", "redmine"
working_directory "/var/www/redmine"

# Listen on Both UNIX and TCP Sockets for Testing
listen "/var/www/redmine/tmp/sockets/.sock", :backlog =&gt; 64
listen 8080, :tcp_nopush =&gt; true

# Default Timeout
timeout 30

# Pid/Logging Config
pid "/var/www/redmine/tmp/pids/unicorn.pid"
stderr_path "/var/www/redmine/log/unicorn.stderr.log"
stdout_path "/var/www/redmine/log/unicorn.stdout.log"

# Preload Rails App for Performance
preload_app true

before_fork do |server, worker|
  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.connection.disconnect!
end

after_fork do |server, worker|
  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.establish_connection
end
</code></pre>

<p>Cela suppose que vous avez décompressé Redmine dans <code>/var/www/redmine</code> et que vous avez un utilisateur <code>redmine</code> appartenant au groupe <code>redmine</code>. Si nécessaire, modifiez toutes les occurrences de <code>/var/www/redmine</code> vers le chemin où vous avez installé Redmine et la ligne <code>user "redmine", "redmine"</code> avec l&#8217;utilisateur et le groupe sous lesquels vous voulez que Redmine s&#8217;exécute. Pour mes tests j&#8217;ai utilisé mon compte utilisateur, mais ce n&#8217;est certainement pas recommandé:</p>

<pre><code>user "olivier", "staff"
</code></pre>

<p>Démarrez ensuite Unicorn en utilisant le wrapper, ce qui signifie qu&#8217;il n&#8217;est pas nécessaire de changer l&#8217;environnement RVM. Cela sera pratique si vous utilisez launchd ou un autre gestionnaire de services pour lancer Redmine:</p>

<pre><code>$ sudo -u redmine redmine_unicorn_rails -c /var/www/redmine/config/unicorn.conf -D -E production
</code></pre>

<p>Si comme moi vous avez utilisé votre propre compte utilisateur comme test, alors le <code>sudo</code> n&#8217;est pas nécessaire:</p>

<pre><code>$ redmine_unicorn_rails -c /var/www/redmine/config/unicorn.conf -D -E production
</code></pre>

<p>D&#8217;après le fichier de configuration, Unicorn tourne sur le port 8080. Si vous avez un serveur Apache sur le port 80 et désirez que Redmine apparaisse sous un préfixe donné, alors vous pouvez probablement utiliser une réécriture de type proxy pour atteindre ce but, à condition d&#8217;avoir activé mod_proxy.</p>

<p>Pour arrêter Unicorn, tuez le process <code>unicorn_rails master</code>.</p>

<h3>Conclusion</h3>

<p>C&#8217;est tout pour aujourd&#8217;hui, j&#8217;espère que cela a été utile. Comme je l&#8217;ai déjà mentionné, je débute avec les applications Rails, alors j&#8217;ai probablement fait des erreurs. N&#8217;hésitez pas à les signaler dans les commentaires, j&#8217;essaierai de mettre à jour ce post en conséquence. Il se peut aussi que j&#8217;ajoute quelque chose concernant l&#8217;utilisation de launchd pour exécuter Redmine sous Unicorn et de mod_proxy pour l&#8217;intégrer avec un site web existant.</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Mac%20OS%20X&amp;limit=20">Mac OS X</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=RVM&amp;limit=20">RVM</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Rails&amp;limit=20">Rails</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Redmine&amp;limit=20">Redmine</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Ruby&amp;limit=20">Ruby</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=RubyGems&amp;limit=20">RubyGems</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Unicorn&amp;limit=20">Unicorn</a></description>
         <guid>http://ithink.ch/blog/2011/10/02/installer_redmine_sur_mac_os_x_106_la_facon_correcte.html</guid>
         <category>Knowledge base</category>
         <pubDate>Sun, 02 Oct 2011 11:04:31 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Installing Redmine on Mac OS X 10.6: The Correct Way</title>
            <link>http://ithink.ch/blog/2011/09/25/installing_redmine_on_mac_os_x_106_the_correct_way.html</link>
         
         <description><![CDATA[<ul>
<li>Ce post est aussi disponible <a href="http://ithink.ch/blog/2011/10/02/installer_redmine_sur_mac_os_x_106_la_facon_correcte.html">en français</a></li>
</ul>

<p>Yes, it’s a rather pretentious title, considering that it’s my first time succeeding at installing a Rails application, and no, I don’t care. It was a pain in the ass so I need to document how I did it, and it might help other people, so if it really bothers you, read it as ‘the correct way for me’.</p>

<p><a href="http://www.redmine.org/">Redmine</a> (1.2.1 of 2011-07-11 as of this writing) is <a href="http://www.redmine.org/projects/redmine/wiki/RedmineInstall#Requirements">pretty touchy about its requirements</a>: gems (and Ruby and RubyGems as well) cannot be too old, some cannot be too recent, and one (i18n) even cannot be anything other than the specified version (0.4.2).</p>

<p>The <a href="http://www.redmine.org/projects/redmine/wiki/RedmineInstall">Redmine installation page</a> says it requires:</p>

<ul>
<li>Ruby 1.8.6 or 1.8.7, not 1.9;</li>
<li>RubyGems 1.3.7 or higher, but not 1.5.0 and not 1.7.0 or higher, because Rails 2.3.11 fails with it;</li>
<li>Rails 2.3.11 (then later tells you that 2.3.14 works as well);</li>
<li>Rack 1.1.1;</li>
<li>Rake 0.8.7 (not 0.9.x because it’s not supported by Rails);</li>
<li>i18n 0.4.2 (the current version 0.6.0 will give you an error that 0.4.2 cannot be found).</li>
</ul>

<p>Moreover, Redmine comes with Rails 2.3.11 bundled in the vendor directory, and will use it unless you remove it from there and change the version you want in <code>config/environment.rb</code>. This is neatly documented on the install page with a very thorough explanation: “read <code>config/environment.rb</code> first”. Just changing the version won’t help: if Redmine finds rails in its vendor directory, it will use that one.</p>

<p>The reality of Redmine requirements is a bit different. Rake 0.9.x is supported by Rails 2.3.14 (it installs 0.9.2 as part of its dependencies), but RubyGems 1.7.0 or higher still isn’t. So to minimise the number of obsolete and buggy software that I run and the fuss that ensues, I am going to use Rails 2.3.14.</p>

<h3>Using RVM</h3>

<p><a href="http://beginrescueend.com/">Ruby Version Manager</a>, or RVM, allows you to use a different version of Ruby and a different set of gems for different projects, without installing said gems system-wide. It is similar to Python’s <a href="http://www.virtualenv.org/">virtualenv</a>. In my opinion, it is absolutely vital to use it right from the start. You never know what other software you might want to install later, software that might have requirements as tricky as Redmine’s, yet different in the actual versions.</p>

<p>RVM can be found at <a href="http://beginrescueend.com/">http://beginrescueend.com/</a> and is <a href="http://beginrescueend.com/rvm/install/">installed thusly</a> (it apparently requires git, which is kind of a bummer if you don’t use it. But you should give it a try, it’s awesome once you start grokking it):</p>

<pre><code>$ bash &lt; &lt;(curl -s https://rvm.beginrescueend.com/install/rvm)
</code></pre>

<p>Then add the following to your <code>.bash_profile</code> or <code>.zshrc</code> (obviously you want to switch to <a href="http://www.zsh.org/">zsh</a> and use <a href="https://github.com/robbyrussell/oh-my-zsh">oh-my-zsh</a>, because they’re awesome too) as the install script will tell you (personalised with your <code>$HOME</code> path):</p>

<pre><code># This loads RVM into a shell session.
[[ -s "/Users/olivier/.rvm/scripts/rvm" ]] &amp;&amp; source "/Users/olivier/.rvm/scripts/rvm"
</code></pre>

<p>Next we need to install the latest pre-1.9 Ruby to use with RVM. RVM will build it from source, but it doesn’t take too long (if you find it does, just head over to <a href="http://9gag.com/">9gag.com</a>. We can list the available Ruby versions, and then install the one we want, namely 1.8.7 (that will result in <code>ruby-1.8.7-p352</code>):</p>

<pre><code>$ rvm list known

# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.6-head
[ruby-]1.8.7[-p352]
[ruby-]1.8.7-head
[ruby-]1.9.1-p378
[ruby-]1.9.1[-p431]
[ruby-]1.9.1-head
[ruby-]1.9.2-p180
[ruby-]1.9.2[-p290]
[ruby-]1.9.2-head
[ruby-]1.9.3[-preview1]
[ruby-]1.9.3-head
ruby-head
...

$ rvm install 1.8.7
...
$ rvm use 1.8.7
</code></pre>

<p>Once done, we will create a gemset for Redmine, where RubyGems will install the gems we need in the versions we need, without interfering with the system installation.</p>

<pre><code>$ rvm gemset create redmine
'redmine' gemset created (/Users/olivier/.rvm/gems/ruby-1.8.7-p352@redmine).
$ rvm gemset use redmine
</code></pre>

<p><strong>Notes:</strong></p>

<ol>
<li><p>The Ruby version and gemset in use  are tied to the shell session, so you have to switch every time you start a new shell. It can be done in one step:</p>

<pre><code>$ rvm use 1.8.7@redmine
Using /Users/olivier/.rvm/gems/ruby-1.8.7-p352 with gemset redmine
</code></pre></li>
<li><p>The current environment can be queried with <code>rvm-prompt</code>:</p>

<pre><code>$ rvm-prompt        
ruby-1.8.7-p352@redmine
</code></pre></li>
<li><p>You can switch back to the system Ruby with:</p>

<pre><code>$ rvm use system
Now using system ruby.
</code></pre></li>
<li><p>You do not need <code>sudo</code> to install gems in an RVN gemset, because all the files are contained in your home directory.</p></li>
<li><p>Rake commands while using a gemset should be prefixed by rvm:</p>

<pre><code>$ rvm rake blah blah
</code></pre></li>
</ol>

<h3>Installing gems</h3>

<p>First of all, let us <a href="http://buddingrubyist.com/2009/02/14/how-to-speed-up-gem-installs-10x/">speed up gem installs 10x</a>, as suggested by <a href="http://buddingrubyist.com/">The Budding Rubbyist</a>. Add the following to your <code>~/.gemrc</code> file, creating it if needed:</p>

<pre><code>gem: --no-ri --no-rdoc
</code></pre>

<p>That will omit installing the documentation (that we will never read as we’re only interested in using Ruby software, not developing some) when installing gems, a step that is inexplicably very lengthy as it usually takes longer than the “Building native extensions. This could take a while…” step of some gems.</p>

<p>Next, make sure we are using the Ruby and gemset we created earlier:</p>

<pre><code>$ rvm use 1.8.7@redmine
</code></pre>

<p>Then install Rails 2.3.14 and i18n 0.4.2 (Rails installs i18n 0.6.0, but remember, Redmine wouldn’t see this one if we forced it into its thick skull with a [we]brick):</p>

<pre><code>gem install rails -v=2.3.14
gem install i18n -v=0.4.2
</code></pre>

<p><strong>Note:</strong> To figure out that it was Rails 2.3.14 that I wanted, I listed all the versions available and picked the latest 2.3.x:</p>

<pre><code>$ gem query  --all --remote -n '^rails$'

*** REMOTE GEMS ***

rails (3.1.0, 3.0.10, 3.0.9, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.3.14, 2.3.12, 2.3.11, 2.3.10, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.4, 2.0.2, 2.0.1, 2.0.0, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.0, 0.14.4, 0.14.3, 0.14.2, 0.14.1, 0.13.1, 0.13.0, 0.12.1, 0.12.0, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.5, 0.9.4.1, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.5, 0.8.0)
</code></pre>

<p>The <code>list</code> command is simpler, but it will list everything that starts with <code>rails</code>, which is a bit of a bother:</p>

<pre><code>$ gem list --all --remote rails

*** REMOTE GEMS ***

rails (3.1.0, 3.0.10, 3.0.9, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.3.14, 2.3.12, 2.3.11, 2.3.10, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.2.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.4, 2.0.2, 2.0.1, 2.0.0, 1.2.6, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.0, 0.14.4, 0.14.3, 0.14.2, 0.14.1, 0.13.1, 0.13.0, 0.12.1, 0.12.0, 0.11.1, 0.11.0, 0.10.1, 0.10.0, 0.9.5, 0.9.4.1, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.5, 0.8.0)
rails-3-settings (0.1.1)
rails-action-args (0.1.1, 0.1.0)
rails-admin (0.0.0)
rails-and-solid (0.9.1, 0.9.0)
...
</code></pre>

<p>I wanted to use SQLite (I couldn’t make the mysql gem build against Zend Server’s MySQL, and I don’t care), so I installed the sqlite3 gem:</p>

<pre><code>gem install sqlite3
</code></pre>

<p>We also need to downgrade RubyGems from the latest version (1.8.10 as of writing) to a version that is at least 1.3.7 but not 1.5.0 and not 1.7.0 or later. The version we want can be determined the same way as for Rails, by querying the rubygems-update gem:</p>

<pre><code>$ gem list --all --remote  rubygems-update

*** REMOTE GEMS ***

rubygems-update (1.8.10, 1.8.9, 1.8.8, 1.8.7, 1.8.6, 1.8.5, 1.8.4, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.2, 1.7.1, 1.7.0, 1.6.2, 1.6.1, 1.6.0, 1.5.3, 1.5.2, 1.5.0, 1.4.2, 1.4.1, 1.4.0, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.0, 1.1.1, 1.1.0, 1.0.1, 1.0.0, 0.9.5, 0.9.4, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.11, 0.8.10, 0.8.8, 0.8.6, 0.8.5, 0.8.4, 0.8.3)
</code></pre>

<p>So we want 1.6.2:</p>

<pre><code>$ gem update --system 1.6.2
...
$ gem -v
1.6.2
</code></pre>

<p>Note that some older version of the <code>gem</code> command, like the 1.3.7 recommended by Redmine, do not support specifying the version in the <code>gem update --system</code> command. In that case, you would need to get the most recent version and then downgrade it:</p>

<pre><code>$ gem update --system
$ gem update --system 1.6.2
</code></pre>

<p>Now let’s proceed to installing Redmine.</p>

<h3>Installing Redmine</h3>

<p><a href="http://www.redmine.org/projects/redmine/wiki/Download">Download</a> the latest stable release (1.2.1 of 2011-07-11 as of this writing) and unpack it.</p>

<p>We need to disable the built-in Rails 2.3.11 and tell Redmine to use our 2.3.14 version. In <code>config/environment.rb</code>, change these lines:</p>

<pre><code># Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
</code></pre>

<p>to:</p>

<pre><code># Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
</code></pre>

<p>Next, move rails out of the vendor directory. If you don’t, Redmine will use the old version no matter what the above line says. I do this:</p>

<pre><code>mv vendor/rails vendor.rails.disabled
</code></pre>

<p>By the way, it’s the “read config/environment.rb first” bit in the requirements list and the “when vendor/rails is not present” in the comment above that tell us that we must remove rails from the vendor directory. As I said, a very thorough explanation.</p>

<p>Next, proceed with installation. With SQLite, <code>database.yml</code> looks like this:</p>

<pre><code>production:
  adapter: sqlite3
  database: db/redmine.db

development:
  adapter: sqlite3
  database: db/redmine.db

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/redmine_test.db
</code></pre>

<p><strong>Note:</strong> The following commands for me were littered with deprecation warnings like this one:</p>

<pre><code>rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
Please install RDoc 2.4.2+ to generate documentation.
WARNING: 'task :t, arg, :needs =&gt; [deps]' is deprecated.  Please use 'task :t, [args] =&gt; [deps]' instead.
    at redmine-1.2.1/lib/tasks/email.rake:170
</code></pre>

<p>As far as I know they don’t matter, apart from the fact that they render it quite difficult to determine whether the task succeeded or not.</p>

<p>Generate a session store secret (don’t forget to <code>rvm rake</code> instead of just <code>rake</code>):</p>

<pre><code>rvm rake generate_session_store
</code></pre>

<p>Create the database structure:</p>

<pre><code>RAILS_ENV=production rvm rake db:migrate
</code></pre>

<p>Insert default configuration data in database:</p>

<pre><code>RAILS_ENV=production rvm rake redmine:load_default_data
</code></pre>

<p>Then test your installation:</p>

<pre><code>ruby script/server webrick -e production
</code></pre>

<p>or</p>

<pre><code>ruby script/server -p 3000 webrick -e production
</code></pre>

<p>It takes a little while to start. The first two lines appear quite quickly and let you check that Redmine is running the correct Rails version:</p>

<pre><code>=&gt; Booting WEBrick
=&gt; Rails 2.3.14 application starting on http://0.0.0.0:3000
</code></pre>

<p>Then the server is ready when you see this:</p>

<pre><code>=&gt; Call with -d to detach
=&gt; Ctrl-C to shutdown server
[2011-09-25 14:28:09] INFO  WEBrick 1.3.1
[2011-09-25 14:28:09] INFO  ruby 1.8.7 (2011-06-30) [i686-darwin10.8.0]
[2011-09-25 14:28:09] INFO  WEBrick::HTTPServer#start: pid=39670 port=3000
</code></pre>

<h3>Running Redmine under Unicorn</h3>

<p>Disclaimer: I have no idea if using Unicorn to run Redmine is a good idea. I just know that WEBrick is not for production and that Passenger is an Apache module, and I’d rather not bother with it if I can avoid it. After all, we reached thus far without need admin privileges.</p>

<p>I found the instruction at <a href="http://blog.ronvalente.net/install-redmine-on-ubuntu-server">Install Redmine on Ubuntu Server</a> from the Redmine HowTo’s list, except the part about the RVM wrapper that comes from <a href="http://brandontilley.com/2011/01/29/serving-rails-apps-with-rvm-nginx-unicorn-and-upstart.html">Brandon Tilley</a>.</p>

<p>Install Unicorn, still under RVM:</p>

<pre><code>$ gem install unicorn
</code></pre>

<p>Create a wrapper for <code>unicorn_rails</code>. The wrapper will run <code>unicorn_rails</code> with the correct Ruby version and gemset:</p>

<pre><code>$ rvm wrapper ruby-1.8.7-p352@redmine redmine unicorn_rails
</code></pre>

<p>This creates a <code>redmine_unicorn_rails</code> command that uses the <code>ruby-1.8.7-p352@redmine</code> environment.</p>

<p>Create the unicorn configuration file <code>unicorn.conf</code>, for example in Redmine’s <code>config</code> directory:</p>

<pre><code># /var/www/redmine/config/unicorn.conf

# Number of CPU Cores
worker_processes 2

# Same Redmine User
user "redmine", "redmine"
working_directory "/var/www/redmine"

# Listen on Both UNIX and TCP Sockets for Testing
listen "/var/www/redmine/tmp/sockets/.sock", :backlog =&gt; 64
listen 8080, :tcp_nopush =&gt; true

# Default Timeout
timeout 30

# Pid/Logging Config
pid "/var/www/redmine/tmp/pids/unicorn.pid"
stderr_path "/var/www/redmine/log/unicorn.stderr.log"
stdout_path "/var/www/redmine/log/unicorn.stdout.log"

# Preload Rails App for Performance
preload_app true

before_fork do |server, worker|
  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.connection.disconnect!
end

after_fork do |server, worker|
  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.establish_connection
end
</code></pre>

<p>This assumes that you unpacked redmine in <code>/var/www/redmine</code> and that you have a <code>redmine</code> user belonging to a <code>redmine</code> group. If needed, change all occurrences of <code>/var/www/redmine</code> to where you installed Redmine and <code>user "redmine", "redmine"</code> to the user and group you want Redmine to run as. For testing, I used my user account, but it’s certainly not recommended:</p>

<pre><code>user "olivier", "staff"
</code></pre>

<p>Then start unicorn using the wrapper, which means we don’t need to enter the RVM environment. This should come in handy if you use launchd or another service system to launch Redmine:</p>

<pre><code>$ sudo -u redmine redmine_unicorn_rails -c /var/www/redmine/config/unicorn.conf -D -E production
</code></pre>

<p>If like me you used your own user account for testing purposes, then you don’t need the <code>sudo</code> part:</p>

<pre><code>$ redmine_unicorn_rails -c /var/www/redmine/config/unicorn.conf -D -E production
</code></pre>

<p>From the config file, Unicorn runs on port 8080. If you have an Apache web site on port 80 and would like Redmine to appear under a given prefix, and have mod_proxy enabled, then you can probably use a proxy rewrite rule to achieve this.</p>

<p>To stop Unicorn, kill the <code>unicorn_rails master</code> process.</p>

<h3>Conclusion</h3>

<p>That’s it for today, I hope this helps. As I already mentioned, I am new to Rails applications, so I probably made mistakes. Don’t hesitate to point them out in the comments, I’ll try and update this post accordingly. I might also add something about using launchd to run Redmine under Unicorn and mod_proxy to integrate with an existing web site.</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Mac%20OS%20X&amp;limit=20">Mac OS X</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=RVM&amp;limit=20">RVM</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Rails&amp;limit=20">Rails</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Redmine&amp;limit=20">Redmine</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Ruby&amp;limit=20">Ruby</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=RubyGems&amp;limit=20">RubyGems</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Unicorn&amp;limit=20">Unicorn</a></description>
         <guid>http://ithink.ch/blog/2011/09/25/installing_redmine_on_mac_os_x_106_the_correct_way.html</guid>
         <category>Knowledge base</category>
         <pubDate>Sun, 25 Sep 2011 16:45:20 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>The Swiss Governement Forbids The iPhone</title>
            <link>http://ithink.ch/blog/2010/07/20/the_swiss_governement_forbids_the_iphone.html</link>
         
         <description><![CDATA[<p>The Swiss governement forbids the iPhone. Only the iPhones, not the Android or the <a href="http://www.macworld.com/article/146554/2010/02/macalope_larry.html">Larry</a> phones. Here’s the text from the communicate of press:</p>

<h3>Security: the federal administration privated of iPhone</h3>

<p>The federal personnel will not receive temporarily more iPhone as mobile phone of service. The informatics department is fearing for the security of the transmitted datas. The Federal Council will decide at the fall on the maintaining or not of this measure.</p>

<p>Some 680 employees of the Confederation actually have an iPhone for professional. The moratorium hitting this type of telephone of capacities near a computer, announced by the “Berner Zeitung”, has been confirmed on Wednesday by the spokesperson of the Federal Department of Finances (FDF) Roland Meier.</p>

<p>At the general secretary of the FDF, the iPhones have even been replaced by other “smartphones”, seeing the collaborators are in narrow contact with the Federal Council. Mr. Meier could not precise if a such exchange has happened in other units.</p>

<p>If one takes to the foot of the letter lhe directives of the Confederation, the iPhones should not be autorized, explains Peter Fischer, delegated at the informatic strategy. “But there rules are technically overtaken.”</p>

<p>The iPhone must not notably be integrated at the informatic systems of the Confederation via iTunes and Apple has then no more access to the datas transferred. An analyse of the security of the telephones said intelligents will be given until the fall at the Federal Council, who will decide the ones to autorize.</p>

<p><strong>Source:</strong> ATS <br />
<strong>Translation:</strong> Oil Tree</p>

<p>The original text is here:</p>

<h2>Sécurité: l&#8217;administration fédérale privée d&#8217;iPhone</h2>

<p>Le personnel fédéral ne recevra temporairement plus d&#8217;iPhone comme téléphone portable de service. Le service informatique craint pour la sécurité des données transmises. Le Conseil fédéral tranchera à l&#8217;automne sur le maintien ou non de cette mesure.</p>

<p>Quelque 680 employés de la Confédération ont actuellement un iPhone à titre professionnel. Le moratoire frappant ce type de téléphone aux capacités proches d&#8217;un ordinateur, annoncé par la &#8220;Berner Zeitung&#8221;, a été confirmé mercredi par le porte-parole 
du Département fédéral des finances (DFF) Roland Meier.</p>

<p>Au secrétariat général du DFF, les iPhones ont même été remplacés par d&#8217;autres &#8220;smartphones&#8221;, vu que les collaborateurs sont en contact étroit avec le Conseil fédéral. M.Meier n&#8217;a pas pu préciser si un tel échange a eu lieu dans d&#8217;autres unités.</p>

<p>Si l&#8217;on prend au pied de la lettre les directives de la Confédération, les iPhones ne devraient pas être autorisés, explique Peter Fischer, délégué à la stratégie informatique. &#8220;Mais ces règles sont dépassées techniquement.&#8221;</p>

<p>L&#8217;iPhone ne doit notamment plus être intégré au système informatique de la Confédération via iTunes et Apple n&#8217;a donc plus accès aux données transférées. Une analyse de la sécurité des téléphones dit intelligents sera remise d&#8217;ici l&#8217;automne au Conseil fédéral, qui décidera lesquels autoriser.</p>

<p><strong>Source:</strong> ATS</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=iPhone&amp;limit=20">iPhone</a></description>
         <guid>http://ithink.ch/blog/2010/07/20/the_swiss_governement_forbids_the_iphone.html</guid>
         <category></category>
         <pubDate>Tue, 20 Jul 2010 02:03:32 +0100</pubDate>
      </item>
      
      <item>
         
         
         
            <title>Mars vs. The Moon</title>
            <link>http://ithink.ch/blog/2009/09/02/mars_vs_the_moon.html</link>
         
         <description><![CDATA[<p>So I&#8217;ve received this e-mail (in French) a couple of times, titled <em>Two Moons in the Sky</em>, saying that on August 27th this year (though the two times I received it were on different years) at 00:30 (<em>precisely</em>, mind you, not during the whole night or for a few nights before and after that date), Mars will be the brightest object in the night sky, as bright (sometimes also as big) as the full Moon, even though it&#8217;s 55 million kilometers from Earth, and that it won&#8217;t happen again before year 2287!</p>

<p>I mean, <strong>WOW!</strong></p>

<p>No, not World of Warcraft. No, not &#8220;Wow, Mars will be as bright as the full Moon&#8221; either.</p>

<p>Rather, &#8220;Wow, I have friends who believe this shit, who believe it enough to forward it to me as a fact, not even to ask me if it&#8217;s true.&#8221; (I happen to have a teeny, tiny PhD in some branch of Physics. Not many people know that.)</p>

<p>What&#8217;s good with this joke is that, by a happy coincidence on the numbers involved, the calculations needed to debunk it can be done in your head. Well, maybe not in your head, but certainly in mine.</p>

<p>See, everybody knows that the Earth is <strong>150 million kilometers</strong> away from the Sun. The e-mail tells us the Earth-Mars distance at its shortest will be <strong>55 million kilometers</strong>, which happens to be the only correct information in the whole message. This gives us the Sun-Mars distance as <strong>150 + 55 = 205</strong>, make is <strong>200 million kilometers</strong>.</p>

<p>Now the amount of sunlight received by a celestial object (or any kind of object, really) is inversely proportional to the square of its distance to the Sun, meaning that if you double the distance, it receives four times less light. So the amount of light received by Mars compared to the Moon (which is at the same distance from the Sun than the Earth) is</p>

<p><img src="http://ithink.ch/blog/files/mars/equation-1.png" alt="(Sun-Moon distance/Sun-Mars distance)^2 = (150/200)^2 = 3/4)^2" title="\left( \frac{\text{Sun--Moon distance}}{\text{Sun--Mars distance}} \right)^2 = \left( \frac{150}{200} \right)^2 = \left( \frac{3}{4} \right)^2." /></p>

<p>Let&#8217;s keep it this way for now.</p>

<p>Then the amount of light reflected by the planet is proportional to its surface, which is proportional to the square of its diameter. Maybe not everybody knows that Mars (<strong>6772 kilometers</strong> in diameter) is twice as big as the Moon (<strong>3475 kilometers</strong>, I told you the numbers involved were convenient), but people know that Mars is &#8220;a bit like Earth&#8221;, which would make it four times bigger than the Moon, which would be in the benefit of Mars and still work. But let&#8217;s stick with the correct numbers. The amount of light reflected by Mars compared to the Moon is therefore</p>

<p><img src="http://ithink.ch/blog/files/mars/equation-2.png" alt="(Mars diameter/Moon diameter)^2 = 2^2 = 4" title="\left( \frac{\text{Mars diameter}}{\text{Moon diameter}} \right)^2 = 2^2 = 4." /></p>

<p>Finally, the amount of light received by the Earth from each of our objects is, like before, inversely proportional to the square of the distance. Again, everybody knows that the Moon is <strong>384 thousand kilometers</strong> away from the Earth. That&#8217;s the average distance. The maximum distance is rather <strong>406 thousand kilometers</strong>. I&#8217;ll round it to <strong>440 thousand kilometers</strong> because it&#8217;s in the detriment of the Moon <em>and</em> it&#8217;s convenient. So the amount of light received by the Earth from Mars compared to the Moon would be (beware the units)</p>

<p><img src="http://ithink.ch/blog/files/mars/equation-3.png" alt="(Moon-Earth distance/Mars-Earth distance)^2 = (440 thousands/55 millions)^2 = (8/1000)^2" title="\left(\frac{\text{Moon--Earth distance}}{\text{Mars--Earth distance}}\right)^2 = \left(\frac{\unit[440]{thousands}}{\unit[55]{millions}}\right)^2 = \left(\frac{8}{1000}\right)^2." /></p>

<p>Now it might be that the surface of Mars reflects light better than the surface of the Moon. It&#8217;s even probable: Mars is red whereas the Moon is black (Don&#8217;t believe me? Remember those rocks they took back from there, like exactly forty years ago? Did they look bright white?). But I&#8217;ll assume they both reflect light equally so we can compare the numbers with real data in the end. We can make the calculation again with Mars ten times brighter than the Moon later if you want.</p>

<p>So, to sum up, we have:</p>

<ul>
<li>Amount of light received by Mars compared to the Moon: <strong>(3/4)<sup>2</sup></strong>; <!-- (3/4)^2 --></li>
<li>Amount of light reflected by Mars compared to the Moon: <strong>2<sup>2</sup></strong>; <!-- 2^2 --></li>
<li>Amount of light received by the Earth from Mars compared to the Moon: <strong>(8/1000)<sup>2</sup></strong>. <!-- (8/1000)^2 --></li>
</ul>

<p>Let&#8217;s multiply all this (because the light reflected is proportional to the light received from the Sun, and the light received on Earth is proportional to the light reflected):</p>

<p><img src="http://ithink.ch/blog/files/mars/equation-4.png" alt="(3/4 * 2 * 8/1000)^2 = (12/1000)^2 = 1.44/10000 = 1/6944" title="\left( \frac{3}{4} \cdot 2 \cdot \frac{8}{1000} \right)^2 = \left( \frac{12}{1000} \right)^2 = \frac{1.44}{10000} = 1/6944." /></p>

<p>The light we get from Mars, in the best case <em>ever</em>, is almost <strong>seven thousand times less</strong> than the light we get from the full Moon. What a surprise! And if we had taken Mars to be as big as the Earth (four times bigger than the Moon instead of two, gives another factor 4 once squared) and ten times brighter than the Moon (i.e. very wrong numbers in its favour), it would still appear 170 times fainter.</p>

<p>Now let&#8217;s check this result quickly. The Wikipedia article on <a href="http://en.wikipedia.org/wiki/Apparent_magnitude">apparent magnitude</a> tells us that the magnitude of the full Moon is <strong>-12.6</strong> and the maximum brightness of Mars is <strong>-2.9</strong>. It also tells us that the ratio in brightness between two objects is given by</p>

<p><img src="http://ithink.ch/blog/files/mars/equation-5.png" alt="2.512^x" title="2.512^x," /></p>

<p>where <strong>x</strong> is the difference between the two magnitudes. In our case:</p>

<p><img src="http://ithink.ch/blog/files/mars/equation-6.png" alt="2.512^((-2.9)-(-12.6)) = 2.512^9.7 = 7589" title="2.512^{(-2.9)-(-12.6)} = 2.512^{9.7} = 7589." /></p>

<p>We weren&#8217;t far with our seven thousand, given the approximations we made, don&#8217;t you reckon?</p>

<p>Do we need to check the claim that Mars can appear <em>as big as the Moon</em>, too? That won&#8217;t take long, now that we&#8217;re experts in the field. The apparent size of an object in the sky is given by the angle under which you see its diameter. In radians and for such small angles, it&#8217;s calculated as <strong>diameter/distance</strong>. Hey, we happen to have all the necessary data already. For Mars:</p>

<p><img src="http://ithink.ch/blog/files/mars/equation-7.png" alt="alpha_Mars = 6772/55 million = 1.23e-4 rad = 25 arc-seconds" title="\alpha_{Mars} = \frac{6772}{\unit[55]{million}} = \unit[1.23 \times 10^{-4}]{rad} = \unit[25]{\text{arc-seconds}}." /></p>

<p>For the Moon:</p>

<p><img src="http://ithink.ch/blog/files/mars/equation-8.png" alt="alpha_Moon = 3475/406000 = 8.6e-3 rad = 29 arc-minutes" title="\alpha_{Mars} = \frac{3475}{406000} = \unit[8.6 \times 10^{-3}]{rad} = \unit[29]{\text{arc-minutes}}." /></p>

<p>That is, Mars appears <strong>70 times</strong> smaller than the Moon in the sky.</p>

<p>So next time you see a message that claims such unbelievable things, make a quick mental calculation before forwarding it to everybody. Or even easier, ask yourself if you have ever seen a celestial object that looked bigger than a dot to the naked eye, apart from the Sun and Moon, and check on the Internet. There are sites like <a href="http://www.hoax-slayer.com/">Hoax-Slayer</a> (English) or <a href="http://www.hoaxbuster.com/">HoaxBuster</a> (French) dedicated to this and checking the validity of such e-mails can be done very quickly.</p>

<p><strong>Next time in this column:</strong> why doesn&#8217;t the height at which you must throw a grenade to have it explode the moment it touches the ground depend on the weight of the grenade?</p>

<div class="footnotes">

</div>
]]><a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Astronomy&amp;limit=20">Astronomy</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Mars&amp;limit=20">Mars</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Moon&amp;limit=20">Moon</a>, <a href="http://ithink.ch/blog/mt-search.cgi?blog_id=1&amp;tag=Science&amp;limit=20">Science</a></description>
         <guid>http://ithink.ch/blog/2009/09/02/mars_vs_the_moon.html</guid>
         <category>Main</category>
         <pubDate>Wed, 02 Sep 2009 01:52:51 +0100</pubDate>
      </item>
      
   </channel>
</rss>
