    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>vaporbase :: Installing Rails on my iMac</title>
        <link>http://www.vaporbase.com/</link>
        <description>the knowledge base that almost is</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Vaporbase Admin</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:admin@parkerhill.com" /> 
       <sy:updatePeriod>hourly</sy:updatePeriod> 
       <sy:updateFrequency>1</sy:updateFrequency> 
       <docs>http://backend.userland.com/rss</docs>

<!-- show a header for the current publication type -->
        <h2>Postings</h2>


<div class="xar-mod-head"><span class="xar-mod-title">rails + xamp</span></div>

<table border="0" cellpadding="1" cellspacing="0">
<tr>
    <td valign="top">
        Browse in :
   </td>
   <td valign="top">

                                    <a href="http://www.vaporbase.com/postings/">All</a>

                 &gt;                     <a href="http://www.vaporbase.com/postings/c36/">subjects</a>

                 &gt;                     <a href="http://www.vaporbase.com/postings/c42/">rails</a>
<br />

                                    <a href="http://www.vaporbase.com/postings/">All</a>

                 &gt;                     <a href="http://www.vaporbase.com/postings/c36/">subjects</a>

                 &gt;                     <a href="http://www.vaporbase.com/postings/c38/">xamp</a>
<br />

                                    <a href="http://www.vaporbase.com/postings/c42-38/">Any of these categories</a>

                -                    <a href="http://www.vaporbase.com/postings/c42+38/">All of these categories</a>
<br />
</td>
</tr>
</table>






<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xd</em>
and <em>user-summary-[publicationtype].xd</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles
The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;Installing Rails on my iMac</h1>
<p><strong>Author:</strong>&nbsp;linoj</p>
<p>
<strong>Date:</strong> January 31, 2007 12:07:03 PM  or Wed, 31 January 2007 12:07:03 </p>
<p><strong>Summary:</strong>&nbsp;Yet another log of one man's blind trek through unfamiliar territory: MacPorts, Apache 2, Ruby, Rails, MySQL5, and even PhP5. Includes a little demo to test the install.
</p>
<p><strong>Body:</strong>&nbsp;<h2>Locomotive? </h2> <p> The first time through I used the no-brainer <a href="http://locomotive.raaum.org/">Locomotive</a>  package. I dont mean to say its not great, it really is so simple. Just download and install it. Everything is self contained - including the http server. It got me going enough to run a few tutorials. </p> <p> Then, as recommended in the Agile book, I decided I should do a more manual install of the separate components. That way I can update individual things as needed, including gems (ruby components). </p> <p> (Note the Agile book claims Locomotive uses SQLite, but i already had mySQL5 installed and it seemed to find it just fine as long as you edit the config/database.yml as needed). </p> <h2>Goin&#39; For It </h2> <p> It all starts here with James Duncan Davidson&#39;s article,  <a href="http://blog.duncandavidson.com/2006/04/sandboxing_rail.html" target="_blank">http://blog.duncandavidson.com/2006/04/sandboxing_rail.html</a> </p> <p> It&#39;s important to note that I already have Apache 1.33 running, with php5 and mysql5. Apache is what came in the box. Php and Mysql I upgraded manually (not with macports). I&#39;m converting to MacPorts so I can upgrade easier in the future using one mechanism.  </p> <h2>MacPorts</h2> <p> The first step is to get the MacPorts package manager, which lets you install (make) and update programs with commands like 	</p><pre>sudo port install &lt;portname&gt;</pre><pre>port search &lt;portname&gt; </pre><pre>port update &lt;portname&gt;<br /></pre> <blockquote> </blockquote> <p> <a href="http://trac.macosforge.org/projects/macports" target="_blank">http://trac.macosforge.org/projects/macports</a> </p> <p> To start they call for Xcode and X11. Fortunately I&#39;d already had those installed (had X11 for Gimp, which I dont use much, it sucks, but that&#39;s another story). Pretty sure you dont need X11 for Rails anyway :)   </p> <p> What I did need to do is setup my .profile (and remove the .bash_profile, copied any commands from there into .profile).  </p> <pre>export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/apache2/bin:$PATH<br />export DISPLAY=:0.0 </pre> <p> and verify with &quot;env&quot; command. Then just download the .dmg package and run the installer.  </p> <p> Then,  </p> <pre>$ sudo port selfupdate </pre> <p>&nbsp;</p> <h2>Get All The Stuff, per Our Friend James </h2> <pre>$ sudo port install apache2<br />$ sudo port install mysql5 +server<br />$ sudo port install subversion +tools<br />$ sudo port install ruby<br />$ sudo port install rb-rubygems<br />$ sudo port install rb-termios<br />$ sudo port install rb-mysql </pre> <pre>$ sudo gem install -y rake<br />$ sudo gem install -y rails<br />$ sudo gem install -y capistrano<br />$ sudo gem install -y mongrel<br />$ sudo gem install -y mongrel_cluster </pre> <p> OK, that went pretty smoothly. Thanks Jimmy. So far so good. Now what? </p> <p> </p>
<p><strong>Notes:</strong>&nbsp;</p>
    <p><div class="xar-pager">

        &nbsp;&nbsp;<span title="First page">First</span>


        &nbsp;&nbsp;<span title="Previous 0 pages">&lt;&lt;</span>


        &nbsp;&nbsp;<span title="Previous page">&lt;</span>

            &nbsp;&nbsp;<span title="Page 1">1</span>
            &nbsp;&nbsp;<a href="http://www.vaporbase.com/postings/Installing_Rails_on_my_iMac?page=2" title="Page 2">2</a>
            &nbsp;&nbsp;<a href="http://www.vaporbase.com/postings/Installing_Rails_on_my_iMac?page=3" title="Page 3">3</a>


        &nbsp;&nbsp;<a title="Next page" href="http://www.vaporbase.com/postings/Installing_Rails_on_my_iMac?page=2">&gt;</a>


        &nbsp;&nbsp;<span title="Next 0 pages">&gt;&gt;</span>



</div></p>
<p><em>More fields may be available via dynamicdata ..</em></p>
        <p>Last modified on Feb 19, 2007 3:50:00 PM by <a href="http://www.vaporbase.com/roles/3">linoj</a></p>
        <p>



<div>
   <p class="xar-cm-note xar-sub">
 Note: Comments are owned by the poster. We are not responsible for their content. </p>
</div>
    <div class="xar-accent-outline xar-cm-comment">
    <div>
         <a name="135"></a>
                <form action="http://www.vaporbase.com/?module=comments&amp;func=reply" method="post" class="xar-cm-actions">
                    <div>
                        <input type="hidden" name="header[modid]" value="151" />
                        <input type="hidden" name="header[itemtype]" value="9" />
                        <input type="hidden" name="header[objectid]" value="85" />
                        <input type="hidden" name="header[pid]" value="135" />
                        <input type="hidden" name="receipt[returnurl][decoded]" value="http://www.vaporbase.com/postings/Installing_Rails_on_my_iMac?&amp;depth=1&amp;order=1&amp;sortby=2&amp;render=flat" />
                        <input type="hidden" name="receipt[returnurl][encoded]" value="http%3A%2F%2Fwww.vaporbase.com%2Fpostings%2FInstalling_Rails_on_my_iMac%3F%26amp%3Bdepth%3D1%26amp%3Border%3D1%26amp%3Bsortby%3D2%26amp%3Brender%3Dflat" />
                        <input type="hidden" name="receipt[action]" value="reply" /> 
                        <input type="submit" name="submit" id="submit-reply135" value="Reply" />
                   </div>
               </form>

                <h4>Installing Rails on my iMac</h4>
<!-- show changelog -->
<!-- end changelog -->
           <span class="xar-sub">
 Posted by:                     Anonymous on                 September 24, 2007 08:45 AM</span>
       </div>
       <div class="xar-accent xar-cm-comment">
                The issue with the symbolic link for tmp/mysql.sock<br/><br/>

The way I understand this is that the mysql.sock gets created when mysql starts up. The link gets lost because the file gets deleted somehow, and therefore also the link.
<br/><br/>
I found a possible solution that seems to work.<br/><br/>

In the launchdeamons there is a wrapper file for mysql.<br/><br/>

I included the mysql.sock symbolic link in that file in the start section. On reboot it seems the link works.<br/><br/>

Here is the code from the wrapper:<br/><br/>
<pre>
#!/bin/sh
#
# MacPorts generated daemondo support script
#

#
# Init
#
prefix=/opt/local

#
# Start
#
Start()
{
	/opt/local/share/mysql5/mysql/mysql.server start
	sudo ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock
}

#
# Stop
#
Stop()
{
	/opt/local/share/mysql5/mysql/mysql.server stop
}

#
# Restart
#
Restart()
{
	Stop
	Start
}

#
# Run
#
Run()
{
case $1 in
  start  ) Start   ;;
  stop   ) Stop    ;;
  restart) Restart ;;
  *      ) echo &quot;$0: unknown argument: $1&quot;;;
esac
}

#
# Run a phase based on the selector
#
Run $1
</pre>                <p>
                    <a href="http://www.vaporbase.com/?module=comments&amp;func=display&amp;cid=135" title="Permalink" rel="bookmark">
                       #
                   </a>
               </p>

       </div>

</div>

<script type="text/javascript" src="modules/base/xartemplates/includes/submitonce.js"></script>
  <h3>Post a new comment</h3> 
  <form action="http://www.vaporbase.com/?module=comments&amp;func=reply" method="post" name="post" id="post" onSubmit="submitonce(this)" id="post"
 >
   <div class="xar-ib-wrapper xar-accent-outline">
<div class="xar-ib-actionpanel xar-accent">
         <span>
 BBCode Actions             : 
          </span>
          <span>
            <!-- New xaraya style link tag <xar:set name="$stylesheet">xarTplAddStyleLink('bbcode', 'bbcode')</xar:set> -->

<span>
    <input type="button" accesskey="z" name="addbbcode18" value=" p " onclick="bbstyle(18)" onmouseover="document.post.helpbox.value='Paragraph: [p]text[/p] (alt+z)'; return true" />
    <input type="button" accesskey="b" name="addbbcode0" value=" b " style="font-weight:bold;" onclick="bbstyle(0)" onmouseover="document.post.helpbox.value='Bold text: [b]text[/b] (alt+b)'; return true" />
    <input type="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic;" onclick="bbstyle(2)" onmouseover="document.post.helpbox.value='Italic text: [i]text[/i] (alt+i)'; return true" />
    <input type="button" accesskey="u" name="addbbcode4" value=" u " style="font-style: underline;" onclick="bbstyle(4)" onmouseover="document.post.helpbox.value='Underline text: [u]text[/u] (alt+u)'; return true" />
    <input type="button" accesskey="q" name="addbbcode6" value="Quote" onclick="bbstyle(6)" onmouseover="document.post.helpbox.value='Quote text: [quote]text[/quote] (alt+q)'; return true" />
    <input type="button" accesskey="c" name="addbbcode8" value="Code" onclick="bbstyle(8)" onmouseover="document.post.helpbox.value='Code display: [code=xml]code[/code] (alt+c)'; return true" />
    <input type="button" accesskey="p" name="addbbcode14" value="Img" onclick="bbstyle(14)" onmouseover="document.post.helpbox.value='Insert image: [img]http://image_url[/img] (alt+p)'; return true" />
    <input type="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline;" onclick="bbstyle(16)" onmouseover="document.post.helpbox.value='Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url] (alt+w)'; return true" />
</span>
<label for="addbbcode20">
 Font color     :
</label>
<select name="addbbcode20" onchange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onmouseover="document.post.helpbox.value='Font color: [color=red]text[/color] Tip: you can also use color=#FF0000'; return true">
   <option style="color:black; background-color: #FAFAFA" value="#444444" class="xar-bbcode-genmed">
 Default </option>
   <option style="color:darkred; background-color: #FAFAFA" value="darkred" class="xar-bbcode-genmed">
 Dark Red </option>
   <option style="color:red; background-color: #FAFAFA" value="red" class="xar-bbcode-genmed">
 Red </option>
   <option style="color:orange; background-color: #FAFAFA" value="orange" class="xar-bbcode-genmed">
 Orange </option>
   <option style="color:brown; background-color: #FAFAFA" value="brown" class="xar-bbcode-genmed">
 Brown </option>
   <option style="color:yellow; background-color: #FAFAFA" value="yellow" class="xar-bbcode-genmed">
 Yellow </option>
   <option style="color:green; background-color: #FAFAFA" value="green" class="xar-bbcode-genmed">
 Green </option>
   <option style="color:olive; background-color: #FAFAFA" value="olive" class="xar-bbcode-genmed">
 Olive </option>
   <option style="color:cyan; background-color: #FAFAFA" value="cyan" class="xar-bbcode-genmed">
 Cyan </option>
   <option style="color:blue; background-color: #FAFAFA" value="blue" class="xar-bbcode-genmed">
 Blue </option>
   <option style="color:darkblue; background-color: #FAFAFA" value="darkblue" class="xar-bbcode-genmed">
 Dark Blue </option>
   <option style="color:indigo; background-color: #FAFAFA" value="indigo" class="xar-bbcode-genmed">
 Indigo </option>
   <option style="color:violet; background-color: #FAFAFA" value="violet" class="xar-bbcode-genmed">
 Violet </option>
   <option style="color:white; background-color: #FAFAFA" value="white" class="xar-bbcode-genmed">
 White </option>
   <option style="color:black; background-color: #FAFAFA" value="black" class="xar-bbcode-genmed">
 Black </option>
</select>
<label for="addbbcode22">
 Font size     :
</label>
<select name="addbbcode22" onchange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onmouseover="document.post.helpbox.value='Font size: [size=x-small]small text[/size]'; return true">
   <option value="7" class="xar-bbcode-genmed">
 Tiny </option>
   <option value="9" class="xar-bbcode-genmed">
 Small </option>
   <option value="12" selected="selected" class="xar-bbcode-genmed">
 Normal </option>
   <option value="18" class="xar-bbcode-genmed">
 Large </option>
   <option value="24" class="xar-bbcode-genmed">
 Huge     </option>
</select>
<a href="javascript:bbstyle(-1)" class="xar-bbcode-genmed" onmouseover="document.post.helpbox.value='Close all open bbCode tags'; return true">Close Tags</a>
<span class="gensmall">
    <input type="text" name="helpbox" size="50" maxlength="100" class="helpline" value="Tip: Styles can be applied quickly to selected text." />
</span>         </span>
       </div>
       <div class="xar-ib-leftpanelshort">
         <p>
 Name :
              Anonymous</p>
         <label for="package-title">
 Title: </label>
            <input class="xar-ib-field" type="text" name="package[title]" id="package-title" value="Installing Rails on my iMac" tabindex="1" />
         <label for="package-text">
 Comment: </label>
<textarea class="xar-ib-fieldtext" name="package[text]" id="package-text" tabindex="2"></textarea>

          <input type="hidden" name="header[modid]" id="header-modid" value="151" /> 
          <input type="hidden" name="header[objectid]" id="header-objectid" value="85" /> 
          <input type="hidden" name="header[itemtype]" id="header-itemtype" value="9" />
<input type="hidden" name="header[pid]" id="header-pid" value="0" />
          <input type="hidden" name="receipt[returnurl][decoded]" id="receipt-returnurl-decoded" value="http://www.vaporbase.com/postings/Installing_Rails_on_my_iMac?&amp;depth=1&amp;order=1&amp;sortby=2&amp;render=flat" />
          <!--<input type="hidden" name="receipt[returnurl][encoded]" id="receipt-returnurl-encoded" value="#$receipt['returnurl']['encoded']#" />-->
          <input type="hidden" name="receipt[action]" id="receipt-action" /> 
          <input type="submit" id="receipt-action-preview" onclick="document.getElementById('receipt-action').value='preview'" value="Preview" /> 
          <input type="submit" id="receipt-action-submit" onclick="document.getElementById('receipt-action').value='submit'" value="Submit" />
       </div>
</div>
 </form>
</p>
        <p></p>
        <p><br/>
<b>Keywords :</b>
<div style="margin-left: 1em; margin-right: 1em; text-align:left;">
    <li><a href="http://www.vaporbase.com/keywords/apache/">apache</a></li>
    <li><a href="http://www.vaporbase.com/keywords/install/">install</a></li>
    <li><a href="http://www.vaporbase.com/keywords/mysql/">mysql</a></li>
    <li><a href="http://www.vaporbase.com/keywords/php/">php</a></li>
    <li><a href="http://www.vaporbase.com/keywords/port/">port</a></li>
</div>
<br/>

</p>
</div>
   </channel>
</rss>
