<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>stew (@) rtmatheson.com &#187; mac</title>
	<atom:link href="http://rtmatheson.com/tag/mac/feed/" rel="self" type="application/rss+xml" />
	<link>http://rtmatheson.com</link>
	<description>My name is Stewart Matheson. I work with code, servers and anything else that makes the web work.  I am also avaiable for hire to help you with any of your projects.</description>
	<lastBuildDate>Mon, 12 Dec 2011 02:02:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Installing Ruby 1.9.2 on Mac os x 10.7 (Lion)</title>
		<link>http://rtmatheson.com/2011/09/installing-ruby-1-9-2-on-mac-os-x-10-7-lion/</link>
		<comments>http://rtmatheson.com/2011/09/installing-ruby-1-9-2-on-mac-os-x-10-7-lion/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 02:30:01 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[1.9.2]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[iconv]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[readline]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=355</guid>
		<description><![CDATA[The other day I updated to Lion from Leopard. I know&#8230; I was keeping it real with an old OS but it got to the point where new apps where not working with leopard. While everything with the operating system update was fine there was a lot of time spent getting my ruby on rails [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I updated to Lion from Leopard. I know&#8230; I was keeping it real with an old OS but it got to the point where new apps where not working with leopard. While everything with the operating system update was fine there was a lot of time spent getting my ruby on rails install back up and running. One thing I did not understand is that I had made the leap to a 64bit system. This means a lot of recompiling as I hate package managers for osx.</p>
<h3>Reinstalling MySQL</h3>
<p>First things first you will need to recompile MySQL from source. I am using 5.1. It seems to be the version of mysql that everyone is using. Some people might stick with sqlite however as I would never use it in production I would also never use it in development so I stick with MySQL. These commands are taken from  Dan Benjamin&#8217;s hivelogic blog. Great work Dan! The link to the article is below in the sources section so if you run in to trouble check the article out.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>mysql.he.net<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>MySQL-<span style="color: #000000;">5.1</span><span style="color: #000000; font-weight: bold;">/</span>mysql-5.1.33.tar.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf mysql-5.1.33.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> mysql-5.1.33
<span style="color: #007800;">CC</span>=<span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-O3 -fno-omit-frame-pointer&quot;</span> <span style="color: #007800;">CXX</span>=<span style="color: #c20cb9; font-weight: bold;">gcc</span> 
<span style="color: #007800;">CXXFLAGS</span>=<span style="color: #ff0000;">&quot;-O3 -fno-omit-frame-pointer -felide-constructors 
-fno-exceptions -fno-rtti&quot;</span> 
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql 
<span style="color: #660033;">--with-extra-charsets</span>=complex <span style="color: #660033;">--enable-thread-safe-client</span> 
<span style="color: #660033;">--enable-local-infile</span> <span style="color: #660033;">--enable-shared</span> <span style="color: #660033;">--with-plugins</span>=innobase
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<h3>Removing the old ruby</h3>
<p>After these steps you should have the database recompiled for the new architecture of Lion. Great lets move on. Its worth noting that I am using RVM. The first thing I needed to do after the update is remove my existing version of ruby. This is the 32bit version and will not work.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm remove 1.9.2</pre></div></div>

<h3>Reinstalling dependencies</h3>
<p>With that done we need to reinstall ruby 1.9.2. We can use RVM to do this however there are a few things we need to update before this. Lets start with libxml. Download the latest version and compile it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf libxml2-2.7.3.tar.gz 
<span style="color: #7a0874; font-weight: bold;">cd</span> libxml2-2.7.3
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--with-python</span>=<span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>Python.framework<span style="color: #000000; font-weight: bold;">/</span>Versions<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2.3</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>After this we need to install libxlst.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>src
curl <span style="color: #660033;">-O</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>xmlsoft.org<span style="color: #000000; font-weight: bold;">/</span>libxslt<span style="color: #000000; font-weight: bold;">/</span>libxslt-1.1.20.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> libxslt-1.1.20
.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>All done now lets move on to readline.</p>
<h3>Installing Readline</h3>
<p>At the time of this writing I was unable to install readline via rvm packages. There is a patch that fixes this however I am not sure its in head yet. The catch here is that in the current state when you install readline it will say that the install has been successful. This is not true. There is <a href="http://groups.google.com/group/rubyversionmanager/browse_thread/thread/4130f40a654242a6?hl=en">a topic on the RVM mailing list</a> about this. For the moment I was able to get around this by compiling and installing readline myself. I have no doubt that this will be fixed soon but for the moment you will need to take this step. This last step is done assuming that you have readline 5.2 downloaded and untared. If you need help then I can add the download link.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">MACOSX_DEPLOYMENT_TARGET</span>=<span style="color: #000000;">10.7</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CFLAGS</span>=<span style="color: #ff0000;">&quot;-arch x86_64 -g -Os -pipe -no-cpp-precomp&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CCFLAGS</span>=<span style="color: #ff0000;">&quot;-arch x86_64 -g -Os -pipe&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">CXXFLAGS</span>=<span style="color: #ff0000;">&quot;-arch x86_64 -g -Os -pipe&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LDFLAGS</span>=<span style="color: #ff0000;">&quot;-arch x86_64 -bind_at_load&quot;</span>
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> shlib
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'s/-dynamic/-dynamiclib/'</span> Makefile <span style="color: #000000; font-weight: bold;">&gt;</span> Makefile.good
<span style="color: #c20cb9; font-weight: bold;">mv</span> Makefile.good Makefile
<span style="color: #7a0874; font-weight: bold;">cd</span> ..
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p>Next lets install zlib and iconv and openssh via RVM.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm pkg <span style="color: #c20cb9; font-weight: bold;">install</span> zlib
rvm pkg <span style="color: #c20cb9; font-weight: bold;">install</span> iconv
rvm pkg <span style="color: #c20cb9; font-weight: bold;">install</span> openssl</pre></div></div>

<h3>Installing Ruby</h3>
<p>Now we can install ruby 1.9.2. This will install the 64 bit version for us.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rvm <span style="color: #c20cb9; font-weight: bold;">install</span> 1.9.2-head <span style="color: #660033;">-C</span> --enable-shared,--with-readline-dir=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #660033;">--with-iconv-dir</span>=<span style="color: #007800;">$rvm_path</span><span style="color: #000000; font-weight: bold;">/</span>usr  <span style="color: #660033;">--with-zlib-dir</span>=<span style="color: #007800;">$rvm_path</span><span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #660033;">--with-openssl-dir</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.rvm<span style="color: #000000; font-weight: bold;">/</span>usr,--build=x86_64-apple-darwin10</pre></div></div>

<h3>Finishing Up</h3>
<p>Once you have recompiled ruby you will need to create a new gem set. For me I have a gem set for each one of my projects so it was a matter of creating the gem set again and then running a bundle install.</p>
<h3>Sources</h3>
<p>http://www.markhneedham.com/blog/2010/07/08/installing-ruby-1-9-2-with-rvm-on-snow-leopard/</p>
<p>http://stackoverflow.com/questions/6317980/bundle-rake-error</p>
<p>http://exceptionz.wordpress.com/2010/02/03/how-to-fix-the-iconv-require-error-in-ruby-1-9/</p>
<p>http://groups.google.com/group/rubyversionmanager/browse_thread/thread/4130f40a654242a6?hl=en</p>
<p>http://techdebug.com/blog/2009/01/03/compiling-readline-on-an-osx-105-intel-x86_64</p>
<p>https://rvm.beginrescueend.com/packages/zlib/</p>
<p>http://nokogiri.org/tutorials/installing_nokogiri.html</p>
<p>http://hivelogic.com/articles/installing-mysql-on-mac-os-x/</p>
]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2011/09/installing-ruby-1-9-2-on-mac-os-x-10-7-lion/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tutorial: Installing Nginx, Apache and SVN</title>
		<link>http://rtmatheson.com/2010/04/installing-nginx-apache-and-svn/</link>
		<comments>http://rtmatheson.com/2010/04/installing-nginx-apache-and-svn/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 14:38:23 +0000</pubDate>
		<dc:creator>Stewart Matheson</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://rtmatheson.com/?p=153</guid>
		<description><![CDATA[In this video I install Nginx Apache and SVN. Download links are here&#8230; http://mirror.lividpenguin.com/pub/apache/httpd/httpd-2.2.15.tar.gz http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz http://nginx.org/download/nginx-0.7.65.tar.gz Here are the apache configurations I used &#60;IfModule mpm_prefork_module&#62; StartServers 1 MinSpareServers 1 MaxSpareServers 1 MaxClients 10 MaxRequestsPerChild 0 &#60;/IfModule&#62; &#160; &#60;Location /repos&#62; DAV svn SVNPath /usr/local/nginx_svn_test/testrepos SVNAutoversioning on Options Indexes FollowSymLinks Order allow,deny Allow from all &#60;/Location&#62; This [...]]]></description>
			<content:encoded><![CDATA[<p>In this video I install Nginx Apache and SVN.  Download links are here&#8230;</p>
<p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10719817&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10719817&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object></p>
<p>http://mirror.lividpenguin.com/pub/apache/httpd/httpd-2.2.15.tar.gz</p>
<p>http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz</p>
<p>http://nginx.org/download/nginx-0.7.65.tar.gz</p>
<p>Here are the apache configurations I used</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;IfModule</span> mpm_prefork_module<span style="color: #000000; font-weight: bold;">&gt;</span></span>
    StartServers          1
    MinSpareServers       1
    MaxSpareServers       1
    MaxClients           10
    MaxRequestsPerChild   0
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Location</span> /repos<span style="color: #000000; font-weight: bold;">&gt;</span></span>
    DAV svn
    SVNPath /usr/local/nginx_svn_test/testrepos
    SVNAutoversioning on
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Location<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This is the Nginx proxy pass configuration</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">location <span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  proxy_pass http:<span style="color: #000000; font-weight: bold;">//</span>localhost:<span style="color: #000000;">86</span>;
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>The following is the line that configures the apache compile.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--enable-dav</span> <span style="color: #660033;">--enable-dav-fs</span> <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx_svn_test <span style="color: #660033;">--disable-alias</span> <span style="color: #660033;">--disable-userdir</span> <span style="color: #660033;">--disable-actions</span> <span style="color: #660033;">--disable-dir</span> <span style="color: #660033;">--disable-negotiation</span> <span style="color: #660033;">--disable-cgi</span> <span style="color: #660033;">--disable-cgid</span> <span style="color: #660033;">--disable-status</span>      <span style="color: #660033;">--disable-autoindex</span> <span style="color: #660033;">--disable-asis</span> <span style="color: #660033;">--disable-mime</span> <span style="color: #660033;">--disable-version</span> <span style="color: #660033;">--disable-setenvif</span> <span style="color: #660033;">--disable-env</span> <span style="color: #660033;">--disable-log-config</span> <span style="color: #660033;">--disable-include</span> <span style="color: #660033;">--disable-filter</span> <span style="color: #660033;">--disable-auth-basic</span> <span style="color: #660033;">--disable-authz-default</span> <span style="color: #660033;">--disable-authz-user</span> <span style="color: #660033;">--disable-authz-groupfile</span> <span style="color: #660033;">--disable-authz-host</span> <span style="color: #660033;">--disable-authn-default</span> <span style="color: #660033;">--disable-authn-file</span></pre></div></div>

<p>The following is the configure line for the SVN install.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx_apache_svn_test <span style="color: #660033;">--with-apxs</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>nginx_apache_svn_test<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>apxs</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rtmatheson.com/2010/04/installing-nginx-apache-and-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

